Access Redux state inside of <Scroll html/> #626
-
Hey. _app.tsxfunction MyApp({ Component, pageProps }: AppProps) {
return (
<Provider store={store}>
<Component {...pageProps} />
</Provider>
);
} Canvas<Canvas>
<ScrollControls
pages={4}
distance={0.6}
damping={8}
horizontal={false}
infinite={false}
>
<Scroll html>
<PageHTML></PageHTML>
</Scroll>
<Scroll>
<D3Scroll />
</Scroll>
</ScrollControls>
</Canvas> The code that produces an errorconst PageHTML: React.FC = () => {
const a = useSelector((state) => (state as State).windows);
const b = bindActionCreators(actionCreators, useDispatch()); Thank you very much for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The way I solved this, for anyone having the same issue is (idk if it is the best possible solution), I wrapped the HTML is a Provider as well. Like this: <Scroll html>
<Provider store={store}>
<PageHTML></PageHTML>
</Provider>
</Scroll> |
Beta Was this translation helpful? Give feedback.
The way I solved this, for anyone having the same issue is (idk if it is the best possible solution), I wrapped the HTML is a Provider as well. Like this: