Edit

The Edit component has 2 main functions. Creating a new record and editing an existing record. To clearly review the changes, all edits can be displayed above the Save button. It also allows to clearly display data into categories (can be set in schema).

Usage

import { Edit } from 'react-adminer';
<Edit entityName={entityName} id={id} />

The Edit component itself is easy to use. It requires only 2 parameters, one is the entityName (the name of the entity - declared in the schema). The second is the id, which should take the value of the idetifier of the record you want to edit. However, if you want to create a new record, the id parameter must be empty.

Example edit record

To display the entity record car, which has id 789-asd I will use the following:

<Edit entityName="car" id="789-asd" />

Example new record

To create a new record for the entity car:

<Edit entityName="car" id="" />

Last updated