Describe the feature you'd love to see
When using componentDidCatch, users might forget to run this.setState to set a new state. In this case, preact will throw an error at process function and fail to set process._rerenderCount = 0, which will prevent future enqueueRender working properly.
I have created two example cases: Preact, React. In this example, when we click the counter up to 3, it will throw an error, and the parent error boundary will not setState in their componentDidCatch.
For React, it will remind user to call setState properly, see their impl at here:
For Preact, it will sliently break and the page will be not interactivable any more.
So I would suggest we can add an error message on this circumstances. I'd be happy to submit a PR to support this; please let me know if you have any suggestion or concerns.
Additional context (optional)
N/A
Describe the feature you'd love to see
When using
componentDidCatch, users might forget to runthis.setStateto set a new state. In this case, preact will throw an error atprocessfunction and fail to setprocess._rerenderCount = 0, which will prevent futureenqueueRenderworking properly.I have created two example cases: Preact, React. In this example, when we click the counter up to 3, it will throw an error, and the parent error boundary will not
setStatein theircomponentDidCatch.For React, it will remind user to call
setStateproperly, see their impl at here:For Preact, it will sliently break and the page will be not interactivable any more.
So I would suggest we can add an error message on this circumstances. I'd be happy to submit a PR to support this; please let me know if you have any suggestion or concerns.
Additional context (optional)
N/A