![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A lightweight framework and utility for building powerful forms in React applications
Say hello to the best React form library you have ever used! Informed is an extensive, simple, and efficient solution for creating basic to complex forms in React. Out of the box you get the ability to grab and manipulate values, validate fields, create custom inputs, multi-step forms, array fields, and much much more!
Oh and YES WE USE HOOKS!
npm install --save informed
See for yourself.
By default it comes with native dom inputs that are controlled by informed.
import { Form, Input, Select, Checkbox, Relevant, Debug } from 'informed';
const onSubmit = ({ values }) => console.log(values);
const ExampleForm = () => (
<Form onSubmit={onSubmit}>
<Input name="name" label="Name" placeholder="Elon" />
<Input name="age" type="number" label="Age" required="Age Required" />
<Input name="phone" label="Phone" formatter="+1 (###)-###-####" />
<Select name="car" label="Car" initialValue="ms">
<option value="ms">Model S</option>
<option value="m3">Model 3</option>
<option value="mx">Model X</option>
<option value="my">Model Y</option>
</Select>
<Checkbox name="married" label="Married?" />
<Relevant when={({ formState }) => formState.values.married}>
<Input name="spouse" label="Spouse" />
</Relevant>
<button type="submit">Submit</button>
<Debug />
</Form>
);
But what if you dont want the out of the box stuff??
No problem, see example below!
import { useForm, useField, Relevant, FormState } from 'informed';
// Step 1. Build your form component ---------------------
const Form = ({ children, ...rest }) => {
const { formController, render, userProps } = useForm(rest);
return render(
<form noValidate {...userProps} onSubmit={formController.submitForm}>
{children}
</form>
);
};
// Step 2. Build your input components --------------------
const Input = props => {
const { render, informed, userProps, ref } = useField({
type: 'text',
...props
});
const { label, id, ...rest } = userProps;
return render(
<>
<label htmlFor={id}>{label}</label>
<input id={id} ref={ref} {...informed} {...rest} />
</>
);
};
const Checkbox = props => {
const { render, informed, userProps, ref } = useField({
type: 'checkbox',
...props
});
const { label, id, ...rest } = userProps;
return render(
<>
<label htmlFor={id}>{label}</label>
<input id={id} ref={ref} {...informed} {...rest} />
</>
);
};
const ErrorInput = props => {
const { render, informed, userProps, fieldState, ref } = useField({
type: 'text',
...props
});
const { label, id, ...rest } = userProps;
const { showError } = fieldState;
const style = showError ? { border: 'solid 1px red' } : null;
return render(
<>
<label htmlFor={id}>{label}</label>
<input id={id} ref={ref} {...informed} {...rest} style={style} />
{showError && <small style={{ color: 'red' }}>{fieldState.error}</small>}
</>
);
};
const Select = props => {
const { render, informed, userProps, ref } = useField({
type: 'select',
...props
});
const { label, id, children, ...rest } = userProps;
return render(
<>
<label htmlFor={id}>{label}</label>
<select id={id} ref={ref} {...informed} {...rest}>
{children}
</select>
</>
);
};
// Step 3. Build your forms! ---------------------------
const onSubmit = ({ values }) => console.log(values);
const ExampleForm = () => (
<Form onSubmit={onSubmit}>
<Input name="name" label="Name" placeholder="Elon" />
<ErrorInput name="age" type="number" label="Age" required="Age Required" />
<Input name="phone" label="Phone" formatter="+1 (###)-###-####" />
<Select name="car" label="Car" initialValue="ms">
<option value="ms">Model S</option>
<option value="m3">Model 3</option>
<option value="mx">Model X</option>
<option value="my">Model Y</option>
</Select>
<Checkbox name="married" label="Married?" />
<Relevant when={({ formState }) => formState.values.married}>
<Input name="spouse" label="Spouse" />
</Relevant>
<button type="submit">Submit</button>
<Debug />
</Form>
);
4.49.5 ( Aug 16, 2023)
FAQs
A lightweight framework and utility for building powerful forms in React applications
The npm package informed receives a total of 136 weekly downloads. As such, informed popularity was classified as not popular.
We found that informed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.