lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

Fix: Invalid hook call when user use export jsx function

Open yuhang-dong opened this issue 3 years ago • 1 comments

Changes

Testing

You can see the full tests from astro/test//react-jsx-export.test.js and astro/test/fixtures/react-jsx-export.

The test will prevent react warning like below:

Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`

Docs

This is not affect a user's behavior, so we don't need to update docs.

yuhang-dong avatar Sep 21 '22 13:09 yuhang-dong