I have this structure in my root layout
export default function RootLayout({ children }) {
const dispatch = useDispatch();
useEffect(() => {
dispatch(fetchProducts());
}, [dispatch])
return (
<Provider store={store}>
<html lang="en">
<body>
<header>
<SearchBar />
<Logo />
<Menu />
</header>
<main>
{children}
</main>
<footer>
<Bottom />
</footer>
</body>
</html>
</Provider>
)
}
The thing is, I want to use Redux in the and components only, so these are the only client components I need. But they are not each other child/parent. What should I do in the situation like that?
Can I somehow create two different providers for each component? I think it won't have sense if I use only client components in my app.