added a new way for native DOM <-> virtual DOM interop, see nativenodes.nim example
This commit is contained in:
parent
a90efe752d
commit
18b5a12d1e
5 changed files with 36 additions and 30 deletions
|
|
@ -1 +1,2 @@
|
|||
--path: "../karax"
|
||||
--path: ".."
|
||||
|
|
|
|||
18
experiments/nativenodes.nim
Normal file
18
experiments/nativenodes.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
|
||||
include karax / prelude
|
||||
import karax / kdom
|
||||
|
||||
proc myInput: VNode =
|
||||
result = buildHtml:
|
||||
input()
|
||||
|
||||
var inp = vnodeToDom(myInput())
|
||||
|
||||
proc myAwesomeComponent(x: Node): VNode =
|
||||
result = dthunk(x)
|
||||
|
||||
proc main: VNode =
|
||||
result = myAwesomeComponent(inp)
|
||||
|
||||
setRenderer main
|
||||
Loading…
Add table
Add a link
Reference in a new issue