Skip to content

An opinionated set of bindings to the React library, optimizing for the most basic use cases

License

Notifications You must be signed in to change notification settings

nukisman/purescript-react-basic

 
 

Repository files navigation

purescript-react-basic

Build Status

This package implements an opinionated set of bindings over React, optimizing for correctness and simplifying basic use cases.

Features

  • All React DOM elements and attributes are supported (soon, events are a work in progress).
  • An intuitive API for specifying props - simple records, no arrays of key value pairs.
  • Attributes are optional, but type-checked. It is a type error to specify href as an integer, for example.
  • An action/update pattern for local component state, inspired by ReasonReact.
  • React lifecycles are available, but not in your way when you don't need them.
  • Typeclasses, like Eq props, can be used in component definitions.

Getting Started

You can install this package using Bower:

bower install purescript-react-basic

Or clone/fork the starter project.

See the documentation for a detailed overview, or take a look at one of the examples:

Migrating from v2 or v3

React.Basic.Compat is a new (but deprecated) module. It matches most of the old API and types (except setStateThen and isFirstMount) to make upgrading easier and more gradual. You can find ^import\sReact\.Basic\b and replace with import React.Basic.Compat, upgrade the package version, and proceed from there one component at a time (or only new components). See the documentation link above for more info on the new API.

About

An opinionated set of bindings to the React library, optimizing for the most basic use cases

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PureScript 86.1%
  • JavaScript 13.9%