Closed sajjadshiasi closed 3 years ago
Is this storybook related? It seems a problem with Redux. If it is, could you generate a repro based on this? It is hard to read code from a github issue, even if properly formatted.
Is this storybook related? It seems a problem with Redux. If it is, could you generate a repro based on this? It is hard to read code from a github issue, even if properly formatted. The problem exactly with Redux. I can't access to props of redux
But this is Storybook's issue list - is the issue related to storybook at all? Or is it exclusive to redux? I don't see any storybook code in what was posted. If it is, there are a few guides about how to create a story with data - one is here I know of a plugin for including redux but it is not official, can be found here Also, please consider doing a repro instead of pasting the code with these steps
I try to pass data from redux props but get undefined and null instead. In react dev tools there are data and I see them. But when I try to set email from props to state I have error that cannot read property ‘email’ of undefined This is my component code :
`
` I just change email : this.props.user to email : this.props.user.email in componentWillReceiveProps. I actually need to set redux props to react state. When I give log from componentWillReceivePropsreturn to me undefined after null.
This is my reducer code : `
And this my app.js file : ` import React, {Component} from "react"; import {Router, Route, Switch, BrowserRouter} from "react-router"; import { Navigation, Footer, Home, About, Download, Support, Blog, Login, StudentRegister, Audit } from "../src/components"; import Register from "../src/components/Register" import CheckCode from "../src/components/register/CheckCode"; import TeacherProfile from "./components/TeacherProfile/TeacherProfile"; import RegisterFinal from "./components/register/RegisterFinal" import PrivateRoute from "./components/PrivateRoute/PrivateRouting"; import store from "./store"; import {Provider} from "react-redux"; import {ToastContainer} from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import {createBrowserHistory} from "history";
This is my store code : ` import { createStore, applyMiddleware, compose } from "redux"; import thunk from "redux-thunk"; import combineReducers from "./reducers";
This log from nextProps.user :