in React JS by
Q:

Can you force a component to re-render without calling setState?

1 Answer

0 votes
by

By default, when your component's state or props change, your component will re-render. If your render() method depends on some other data, you can tell React that the component needs re-rendering by calling forceUpdate().

component.forceUpdate(callback)

It is recommended to avoid all uses of forceUpdate() and only read from this.props and this.state in render().

Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
asked Feb 7, 2020 in Onsen UI by DavidAnderson
+1 vote
asked May 22, 2019 in Other by Derya
0 votes
asked Jun 19, 2020 in React JS by JackTerrance
0 votes
asked Jul 2, 2019 in React JS by Venkatshastri
0 votes
asked Dec 8, 2020 in React JS by SakshiSharma
...