-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle
useStateBy
and withPropsChildren
- Loading branch information
Showing
18 changed files
with
449 additions
and
65 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
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
19 changes: 19 additions & 0 deletions
19
...Emissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildren.scala
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,19 @@ | ||
package japgolly.scalajs.react.test.emissions | ||
|
||
import japgolly.scalajs.react._ | ||
import japgolly.scalajs.react.vdom.html_<^._ | ||
|
||
object HooksWithChildren { | ||
|
||
val Component = ScalaFnComponent.withHooks[Int] | ||
.withPropsChildren | ||
.useState(123) | ||
.render { (p, c, s1) => | ||
val sum = p + s1.value + c.count | ||
<.button( | ||
"Sum = ", sum, | ||
^.onClick --> s1.modState(_ + 1), | ||
c | ||
) | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...issions/js/src/main/scala/japgolly/scalajs/react/test/emissions/NoHooksWithChildren.scala
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,14 @@ | ||
package japgolly.scalajs.react.test.emissions | ||
|
||
import japgolly.scalajs.react._ | ||
import japgolly.scalajs.react.vdom.html_<^._ | ||
|
||
object NoHooksWithChildren { | ||
|
||
val Component = ScalaFnComponent.withHooks[Int] | ||
.withPropsChildren | ||
.render { (p, c) => | ||
val sum = p + c.count | ||
<.div("DEBUG = ", sum) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
function App() { | ||
return React.createElement("div", {}, "count is: 0"); | ||
} | ||
|
||
export default App |
12 changes: 12 additions & 0 deletions
12
library/testEmissions/jvm/src/test/resources/rr-js/fn-out.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,12 @@ | ||
import React from 'react'; | ||
|
||
function App() { | ||
return React.createElement("div", {}, "count is: 0"); | ||
} | ||
|
||
_c = App; | ||
export default App; | ||
|
||
var _c; | ||
|
||
$RefreshReg$(_c, "App"); |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.