class CardComponent extends Component {
        componentDidMount() {
          const self = this;
          api.getData(data => self.setState({ articleData: data }));
        render() {
          return (
              <h1>{'This will always render'}</h1>
              { this.state && this.state.articleData &&
                <div>{'This will render after the return of the async call'}</div>

      Javascript language logo
      your recipe card header background


      The CardComponent renders a simple h1 with a message that will always be rendered, and a div with the rendered data after the return of the async call.

      Shortcut: react.CardComponent


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.