First Steps
Installation
To install React Form Architect to your project run command
yarn add rfa
or
npm i rfa
React Form Architect is completely written in Typescript, therefore all types are already bundled within the package
Using RFA
Minimal working example
import React from 'react';
import { FormRenderer, FormArchitect } from 'rfa';
import type { FormSchemaType } from 'rfa';
const App = () => {
const [formData, setFormData] = React.useState<FormSchemaType>();
const handleOnFormSave = (formSchema: FormSchemaType) => {
console.log(formData);
// do something with form data
};
return (
<div>
<FormArchitect onSave={handleOnFormSave} />
{formData && (
<FormRenderer onSubmit={(data) => console.log(data)} data={formData} />
)}
</div>
);
};
Run local example
first bundle or run library code. From within root
run:
yarn start
or
yarn prepare
then run example environment.
cd example/ && yarn start
localhost will run on port :1234
Check out Components