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 2,364 times
1
Abhishek
- 13
- 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 – Dheeraj Apr 09 '20 at 22:48
1 Answers
0
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
- 890
- 4
- 15
-
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