upgrade version
Unanswered
Northeast Congo Lion posted this in #help-forum
Northeast Congo LionOP
I have a old version code with react 16.7.0 and next 6.0.3
how can I upgrade below code to react 18.0 and next 13, I mean how can I treat
componentDidMount(), componentDidUpdate(),
mapStateToProps , mapDispatchToProps ,withRedux, this.setState(), this.state
please give me example about old code like below
--------------------------------------------
class JobSearch extends Component {
constructor(props) {
//---------------
}
componentDidMount() {
//-----------
}
componentDidUpdate(prevProps, prevState) {
//-------------
}
return (
<div></div>
);
}
}
const mapStateToProps = (state) => {
const { app, posts } = state;
return {
location: app.location,
keyword: posts.facets.keyword,
};
};
const mapDispatchToProps = (dispatch) => ({
storeKeyword: (keyword, isCompany) =>
dispatch(setFilterKeyword(keyword, isCompany)),
});
export default withRedux(
Store,
mapStateToProps,
mapDispatchToProps
)(withReduxSaga(JobSearch));
---------------------------------------------------
how can I upgrade below code to react 18.0 and next 13, I mean how can I treat
componentDidMount(), componentDidUpdate(),
mapStateToProps , mapDispatchToProps ,withRedux, this.setState(), this.state
please give me example about old code like below
--------------------------------------------
class JobSearch extends Component {
constructor(props) {
//---------------
}
componentDidMount() {
//-----------
}
componentDidUpdate(prevProps, prevState) {
//-------------
}
return (
<div></div>
);
}
}
const mapStateToProps = (state) => {
const { app, posts } = state;
return {
location: app.location,
keyword: posts.facets.keyword,
};
};
const mapDispatchToProps = (dispatch) => ({
storeKeyword: (keyword, isCompany) =>
dispatch(setFilterKeyword(keyword, isCompany)),
});
export default withRedux(
Store,
mapStateToProps,
mapDispatchToProps
)(withReduxSaga(JobSearch));
---------------------------------------------------