Skip to content

find asynchronous receiveprops solution for displaying a vote (conditional rendering) #67

@Createdd

Description

@Createdd

currently @singlePollCon:

  componentWillReceiveProps(nextProps) {
    setTimeout(() => {
      axios
				.get(`/api/polls/${this.props.match.params.id}`)
				.then((res) => {
  this.setState({ poll: res.data, fetched: true });
})
				.catch((err) => {
  console.log(err);
});
    }, 100);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions