npm i --save preact-nativescript-components
- Version: 0.0.7-2
- GitHub:
- NPM: https://www.npmjs.com/package/preact-nativescript-components
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
preact-nativescript-components
preact-nativescript-components was made to use JSX-Syntax for preact-to-nativescript components
Usage
You should mostly be able to import and use the NativeScript UI Components by name e.g.
import application from "tns-core-modules/application"
import { render } from "preact-to-nativescript"
import {
ActionBar, ActionItem, Button, Label, Page, ScrollView, StackLayout
} from "preact-nativescript-components"
application.start({
create: () => {
return render(
<Page>
<ActionBar>
<StackLayout>
<Label>Custom Header</Label>
</StackLayout>
<ActionItem text="act" />
</ActionBar>
<StackLayout>
<Label>PageContent</Label>
<Button text="Button" />
</StackLayout>
</Page>
)
}
})