ComponentWillMount has been renamed and deprecated, and is not recommended to be used
constructor(props) {
super(props);
this.state = {
cartItems: []
};}
componentWillMount() {
AsyncStorage.getItem("CART", (err, res) => {
if (!res) this.setState({ cartItems: [] });
else this.setState({ cartItems: JSON.parse(res) });
});}
what should I do to fetch the cartItems before rendering ??