I was going through React life -cycle method so a questions comes in my mind. SO Sharing here : Can we call react's render() function forcefully ?
as we call $apply() in angular JS
Asked
Active
Viewed 3,036 times
3

Abhishek
- 33
- 1
- 5
-
i don't think this question is answered, the answers give an alternate way to achieve the result but never explains why its not possible to call render manually – some_groceries Apr 09 '20 at 22:48
1 Answers
1
If you want to render a component you can use ReactDOM.render()
If you want to force a component to update you can use forceUpdate

h1b9b
- 1,010
- 5
- 16
-
but can I call this.render() from any lifecycle method or any user defined method ? – Abhishek Apr 07 '19 at 14:51
-
@abhishek Rendering a component and calling the render method it's not the same thing. Updating a component implies call all lifecycle methods in order – h1b9b Apr 08 '19 at 01:05