React Hooks Tutorial - 11 - useContext API

Опубликовано: 14 Август 2021
на канале: JAS ACADAMY
135
6

Context provides a way to pass data or state through the component tree without having to pass props down manually through each nested component. It is designed to share data that can be considered as global data for a tree of React components, such as the current authenticated user or theme(e.g. color, paddings, margins, font-sizes).

Context API uses Context. Provider and Context. Consumer Components pass down the data but it is very cumbersome to write the long functional code to use this Context API. So useContext hook helps to make the code more readable, less verbose and removes the need to introduce Consumer Component. The useContext hook is the new addition in React 16.8.

The useContext accepts the value provided by React.createContext and then re-render the component whenever its value changes but you can still optimize its performance by using memorization


React Native | React Native tutorial | React Native app | React Native tutorial for beginners | React Native crash course | React Native project | React Native app tutorial | React | mobile app development | tutorial | React Native for beginners | app development | React-Native | programming | React Native course | learn React Native | React Native 2020 | learn React | ReactNative | React Native mobile app | React Native full course | React Native hooks | React Native ui design | React Native ui | React tutorial | React vs React Native | beginners | javascript | React Native live coding | React-Native tutorial | React Native project tutorial | React Native tutorials for beginners | mobile development | what is React Native | React ntive app | React Native navigation | React Native list | React navigation | React Native projects for beginners | set up React Native | design to React Native | React Native code | adding font to React Native | React Native project setup | build an app | learn app development | let's code React Native | install React Native | React Native setup | React Native vs code | React Native introduction | React Native windows | javascript mobile app | React Native basics | React Native beginner tutorial | why learn React Native | what is React Native used for | why React Native | why React Native is not garbage | introduction to React Native | create React Native app | React Native forms | React Native app build | React Native beginner | intro to React Native | React Native scrollview | React Native scroll view | React Native flat list | flatlist React Native | flat list component | React Native lists | React Native usestate | React Native text input | React text input | React Native animated splash screen | React Native animatable | React Native login signup and navigation example | React Native login screen | React Native linear gradient tutorial | React Native splash screen | React Native splash screen animation | login & signup ui in React Native | login and signup screen in React Native | React Native linear gradient | beginner app | drawer navigator | drawer navigation | stack navigation | app build | React app | React navigator | scroll view | React list | list data