27
loading...
This website collects cookies to deliver better user experience
You need to decide whether you should go for redux or context API?
State is one of the core part of React Application. You can consider as a heart of your application.
Don't you think this pattern will start to became weird?
const App = () => {
// fetching some notifications APIs
useEffect(() => {
axios...
}, [])
return <Home notifications={notifications} />
}
const Home = ({ notifications }) => {
return <Pagebase>
<Notification notifications={notifications} />
....
....
</Pagebase>
}
So here we are passing notifications props through App, Home and Notifications and this will became hard to manage. This situation is known as "Prop Drilling"
redux-persist
to enable offline support.Everything comes at cost!
useContext
hooks.