The lifecycle method componentWillMount has been deprecated since react version 16.3 (around March '18), so I wouldn't recommend using it. It's been replaced with UNSAFE_componentWillMount obviously meant for the legacy codebase upkeep. Feel free to implement data fetching in the componentDidMount function or even outside of the view component when external state management (e.g., redux) is used in your stack.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The lifecycle method
componentWillMounthas been deprecated since react version 16.3 (around March '18), so I wouldn't recommend using it. It's been replaced withUNSAFE_componentWillMountobviously meant for the legacy codebase upkeep. Feel free to implement data fetching in thecomponentDidMountfunction or even outside of the view component when external state management (e.g., redux) is used in your stack.