V
V
Vanya Huk2018-09-25 02:45:14
React
Vanya Huk, 2018-09-25 02:45:14

How to render a react component only after an ajax request that will update the store?

How to render a react component only after an ajax request that will update the store?
those. there is a react component, and an ajax request is made in the constructor, after which you need to update redux and only then draw the component

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-09-25
@vanyahuk

render() {
  const { someStateKey } = this.props;  

  if (!someStateKey) return null;

  return (
    {/* component JSX code */}
  );
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question