Vanilla JavaScript

The quick-start example uses the plain javascript React.createElement / preact.h syntax.

The following is a list of accepted component names, sorted just like the NativeScript cookbook navigation and also linkng there.

JSX

If you prefer JSX check out preact-nativescript-components which makes the code look like so:

var application = require("application")
import { render } from "preact-to-nativescript"
import { Page, ActionBar, StackLayout, Label } from "preact-nativescript-components"

application.start({
  create: () => {
    return render(
      <Page>
        <ActionBar title="Custom Title" />
        <StackLayout>
          <Label text="preact-to-nativescript page">
        </StackLayout>
      </Page>
    )
  }
})

results matching ""

    No results matching ""