0.0.4-alpha.1 • Published 1 year ago
@dominative/solid v0.0.4-alpha.1
DOMiNATIVE-Solid
Custom render and patches for SolidJS to work with DOMiNATIVE on NativeScript
Installation
Via npm:
npm install @dominative/solid dominative undom-ng solid-js
Note: dominative
, undom-ng
, solid-js
are peer dependencies, you have to install them manually.
Usage
import { Application } from "@nativescript/core"
import { render } from "@dominative/solid"
import { createSignal } from "solid-js"
const App = () => {
const [count, setCount] = createSignal(0)
const increment = () => {
setCount(c => c + 1)
}
return <>
<actionbar title="Hello, SolidJS!"></actionbar>
<stacklayout>
<label>You have taapped {count()} time(s)</label>
<button class="-primary" on:tap={increment}>Tap me!</button>
</stacklayout>
</>
}
const create = () => {
render(App, document.documentElement)
return document
}
Application.run({ create })
Caveats
Event handling
Use on:raw-EventName
and oncapture:RawEvent-Name
to register event handlers instead of on___
. It may be a little annoying, but NativeScript uses case sensitive event names and don't have native event bubbling, which means delegation couldn't function.
To enable capture and bubble phase of an event, please refer to this doc
License
MIT
0.0.3-alpha.2
1 year ago
0.0.4-alpha.1
1 year ago
0.0.3-alpha.1
1 year ago
0.0.2-alpha.2
2 years ago
0.0.2-alpha.1
2 years ago
0.0.1-alpha.4
2 years ago
0.0.1-alpha.3
2 years ago
0.0.1-alpha.2
2 years ago