Click on "Click ME to trigger Error!" in the right browser
Now see the error, but it's "undefined"!
You can also open the right console, the console log will be "getDerivedStateFromError: undefined"
Expected behavior
After click on "Click ME to trigger Error!", the error message should be "test error" not "undefined" -- The input argument of getDerivedStateFromError should be the thrown error with message "test error"
Screenshots
If applicable, add screenshots to help explain your problem.
(please complete the following information)
Device: Mac
OS: macOS
Browser: Chrome
Rax Version: 1.2.0
Additional context
After I searched getDerivedStateFromError in the source code of Rax, I found the following code:
Describe the bug A clear and concise description of what the bug is.
The input argument of
getDerivedStateFromError
of class component is missing.To Reproduce Steps to reproduce the behavior:
Expected behavior After click on "Click ME to trigger Error!", the error message should be "test error" not "undefined" -- The input argument of
getDerivedStateFromError
should be the thrown error with message "test error"Screenshots If applicable, add screenshots to help explain your problem.
(please complete the following information)
Additional context After I searched
getDerivedStateFromError
in the source code of Rax, I found the following code:--https://github.com/alibaba/rax/blob/36ba0537eb4649f259abb8d96e2c72dc4985794a/packages/rax/src/vdom/performInSandbox.js#L42
Maybe this bug is very easy to fix