Closed dinukadesilva closed 7 years ago
Actually, since init method does changes to the state, this init method has to be called in componentDidMount and init method has to be binded to the component too. Otherwise, the changes happen to the state are not being persisted.
componentDidMount
https://github.com/99xt/serverless-react-boilerplate/blob/c55ea284b568aded687eda26591f6e02cf902ef4/web/src/components/app.js#L24
Actually, since init method does changes to the state, this init method has to be called in
componentDidMount
and init method has to be binded to the component too. Otherwise, the changes happen to the state are not being persisted.https://github.com/99xt/serverless-react-boilerplate/blob/c55ea284b568aded687eda26591f6e02cf902ef4/web/src/components/app.js#L24