Skip to content

asidelnik/react-typescript-generics

Repository files navigation

React Typescript Generic components

  • Generic routing, generic tables and generic forms
  • Custom Hooks

Demo site link

FrontEnd tasks to add a page

  1. Add an interface with the page data fields (Ex: IDatabase.ts)
  2. IUnion.ts - add the interface to the IDataUnion interface
  3. pagesMetaData.ts - add a page object to the pagesMetaData array

BackEnd tasks to add a page

  • Real site - add a server endpoint & DB data.
  • Demo project - add a new data array per page to the JSON Server db.json file.

The magic of Generics

  • Each data field in a page is attached meta data that tells the Generic Components about its functionality & design.
  • This is configured in the FieldsData type.
image