Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61c0bae
commit 4f9b9c4
Showing
5 changed files
with
70 additions
and
112 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
4 changes: 3 additions & 1 deletion
4
...-react-constant-elements/test/fixtures/allowMutablePropsOnTags/function-closure/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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
function Component({ | ||
increment | ||
}) { | ||
return () => <Counter onClick={value => value + increment} />; | ||
var _Counter; | ||
|
||
return () => _Counter || (_Counter = <Counter onClick={value => value + increment} />); | ||
} |
4 changes: 3 additions & 1 deletion
4
...ct-constant-elements/test/fixtures/allowMutablePropsOnTags/function-impure-body/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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
var _Counter; | ||
|
||
function Component() { | ||
return () => <Counter onClick={value => value + prompt("Increment:")} />; | ||
return () => _Counter || (_Counter = <Counter onClick={value => value + prompt("Increment:")} />); | ||
} |
4 changes: 3 additions & 1 deletion
4
...stant-elements/test/fixtures/allowMutablePropsOnTags/function-same-binding-name/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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
var _Counter; | ||
|
||
function Component({ | ||
value | ||
}) { | ||
return () => <Counter onClick={value => value + 1} />; | ||
return () => _Counter || (_Counter = <Counter onClick={value => value + 1} />); | ||
} |
4 changes: 3 additions & 1 deletion
4
...ransform-react-constant-elements/test/fixtures/allowMutablePropsOnTags/function/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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
var _Counter; | ||
|
||
function Component() { | ||
return () => <Counter onClick={value => value + 1} />; | ||
return () => _Counter || (_Counter = <Counter onClick={value => value + 1} />); | ||
} |