0 votes
in ReactJS by
What is context?

1 Answer

0 votes
by
Context provides a way to pass data through the component tree without having to pass props down manually at every level.

For example, authenticated user, locale preference, UI theme need to be accessed in the application by many components.

const {Provider, Consumer} = React.createContext(defaultValue)

Related questions

0 votes
asked Aug 31, 2023 in Android by Robindeniel
0 votes
asked Jan 31, 2021 in ReactJS by Robindeniel
0 votes
asked Jan 30, 2021 in ReactJS by rajeshsharma
...