You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, componentDidMount returns nothing. It is the recommended lifecycle hook for performing async operations. It is necessary to create wrapper functions returning a promise to test such operations (#14687).
What is the expected behavior?
Unlike the suggestion in #1739 etc do not recommending changing any rendering semantics. Simply allow a promise to be returned so that testing does not require boilerplate.
The text was updated successfully, but these errors were encountered:
Have been discussing and exploring this feature in my applications.
Am leaning towards making this more a documentation change, ie updating the website to illustrate patterns for retaining and testing a ref to a Promise.
If React doesn't use the promise, can see a pragmatic argument against changing the signature of the method.
Downstream libraries such as linting etc would have to be updated, which seems a high cost.
Do you want to request a feature or report a bug?
Feature Request
What is the current behavior?
Currently,
componentDidMount
returns nothing. It is the recommended lifecycle hook for performing async operations. It is necessary to create wrapper functions returning a promise to test such operations (#14687).What is the expected behavior?
Unlike the suggestion in #1739 etc do not recommending changing any rendering semantics. Simply allow a promise to be returned so that testing does not require boilerplate.
The text was updated successfully, but these errors were encountered: