Page MenuHomec4science

ContextProvider.md
No OneTemporary

File Metadata

Created
Fri, Jun 7, 18:05

ContextProvider.md

### Context Provider Description
Context provides a way to pass data through the component tree without having to pass props down manually at every level.
[React Context Documentation](https://reactjs.org/docs/context.html)
### Context Provider exemple to access the context Hook
```js static
import React, {useContext} from 'react';
import {Context} from "../ContextProvider"
//call the custom hook to share the state between different level componant
const { getSelectedInstitId,
getSelectedJournalId,
getSelectedFunderId,
institList,
journalList,
funderList,
institId,
journalId,
funderId,
setInstitId,
setJournalId,
setFunderId,
url
}
= useContext(Context)
```
Any [Markdown](http://daringfireball.net/projects/markdown/) is **allowed** _here_.

Event Timeline