Category : redux

The Portal component is being called twice. Why is it happening? How can I prevent that? index.js const App = () => { const theme = lightTheme; return ( <Provider store={store}> <StyleSheetManager> <ThemeProvider theme={theme}> <BrowserRouter> <Portal /> </BrowserRouter> <GlobalStyle /> </ThemeProvider> </StyleSheetManager> </Provider> ); }; ReactDOM.render(<App />, document.getElementById("app")); Portal.jsx class Portal extends React.Component { isAuthenticated ..

Read more

I know this is a newbie question, but I’m stuck. I did a const {user} = useSelector((state) => ({ …state })) I got the following result for user … {name: "client", email: "[email protected]", token: "eyJhbGciOiJSUzI1Ni…, role: "client", _id: "609bf94a70cea62a80c1fe95"} email: "[email protected]" name: "client" role: "client" token: "eyJhbGci… _id: "609bf94a70cea62a80c1fe95" How do I pull out the ..

Read more

To give a quick rundown of my app, it’s an app where you can take tests, score yourself, and record your scores. It uses Firebase Auth and Firestore and Redux to help do all this. I’m having a problem when it comes to signing out of the user’s account. redux/actions/index.js: import { USER_STATE_CHANGE, CLEAR_DATA, USER_TESTS_COMPLETED_STATE_CHANGE ..

Read more

Please I am working on a redux project but the data that was returned to mapStateToProps was not send to the component. Console.log props are undefined LiveEvent.protoTypes = { event: PropTypes.object.isRequired, error: PropTypes.string, }; const mapDispatchToProps = (dispatch) => { return { getSingle: (values) => { console.log(Creators, "creators") dispatch(Creators.getOneEvent(values)); }, }; }; const mapStateToProps = ..

Read more