-
-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer/react): the refresh plugin cannot handle member expre…
…ssions with React hooks (#5655) The previous implementation doesn't handle nested StaticMemberExpression. For example: `A.B.C.useHook`.
- Loading branch information
Showing
4 changed files
with
54 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...n-transform-react-jsx/test/fixtures/refresh/nested-member-expression-with-hooks/input.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function Bar () { | ||
A.B.C.useHook() | ||
} |
9 changes: 9 additions & 0 deletions
9
...n-transform-react-jsx/test/fixtures/refresh/nested-member-expression-with-hooks/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var _s = $RefreshSig$(); | ||
export function Bar() { | ||
_s(); | ||
A.B.C.useHook(); | ||
} | ||
_s(Bar, "useHook{}", true); | ||
_c = Bar; | ||
var _c; | ||
$RefreshReg$(_c, "Bar"); |