geekyme / demo-react-hooks

A demo on how to use react hooks for everything

Home Page:https://demo-react-hooks.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

demo-react-hooks

Coverage Status

Build Status

A demo on how to use react hooks for everything. DEMO

A few examples are show cased here:

A standalone form field

  • Using custom useFormState to mask complexity of getting data from context / state

A Form with many fields

  • Using custom useFormState to mask complexity of getting data from context / state

A Form builder

  • Using custom useGraph hook, which accepts a graph of components and relationships. This allows us to build a complex form with conditional rendering fields.

A Form builder with huge number of fields and relationships

  • An exaggerated version of the previous example, where changing the first field will copy the value to all the other X fields

Setup

This project is built on top of NextJS for convenience

  1. npm install
  2. npm run dev
  3. (For production build) npm run build && npm start

About

A demo on how to use react hooks for everything

https://demo-react-hooks.now.sh/


Languages

Language:JavaScript 78.4%Language:CSS 21.6%