Package

purescript-react-basic-native

Repository
dwhitney/purescript-react-basic-native
License
Apache-2.0
Uploaded by
dwhitney
Published on
2019-05-24

This library builds off purescript-react-basic to enable React Native (0.57 at the time of writing). 99% of the library is codegen'd from the React Native typescript type declaration. Look in the codegen directory for the code that does this. We've recreated the counter and controlled-input examples from purescript-react-basic in the examples directory. They are nearly identical except for events, which are discussed below.

Events

The event types in React Native are a little more rich than they are in React, so we've created a new event type called NativeSyntheticEvent a, where a is the type of the nativeEvent field. In general this is nice, but requires some additional type annotations when used with the merge function. This is illustrated in the controlled-input example. Correspoinding functions from the React.Basic.DOM.Events module are in the React.Basic.Native.Events module.