|
|
|
|
|
by danabramov
3007 days ago
|
|
>I just searched the the web app I am currently writing and it uses componentWillReceiveProps() ~20 times. How many components do you have? Absolute number doesn’t tell me a lot. :-) >Most cases are for detecting changes requiring freeing/fetching network based resources where the data involved can get excessive if care is not taken. Not sure I fully understand. Could you provide a small example? |
|
A form of master/detail is driving the need to detect prop changes to fetch additional data while freeing previous data. Consider the master/detail of multiple levels deep driven by route parameters through the ui hierarchy. In RN, this is less of an issue since screens tend to be more focused and ui stack driven. But users working full-time in a complex ui specialized for power users can require much more data/dynamism.