Hello,
I am working on a program that allows the users to create and remove boxes with React Redux.
https://codepen.io/michaelnicol/pen/eYGwojZ?editors=1010
It has a Presentational
component which will be used to control the rest of the app.
The issue now becomes connecting the react to redux:
let store = createStore(reducer, {});
let Container = ReactRedux.connect(mapDispatch)(Presentational);
class AppWrapper extends React.Component {
constructor(props) {
super(props)
console.log("AppWrapper Called")
}
render() {
return(
<Provider store={store}>
<Container/>
</Provider>
)
}
}
console.log(<AppWrapper/>)
ReactDOM.render(<AppWrapper/>, document.getElementById('root'));
When I try to connect my React and Redux store, I get a #321
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See Rules of Hooks – React for tips about how to debug and fix this problem.