React Scan
react-scan
Scan your React app for renders
Forms
react
react-scan
react scan
render
performance
Forms
javascript
npm
frontend
open source
Stars
22k
Weekly
727k
Open issues
77
Bundle
~25 kB
Installation
npm install react-scanCode example
import { useScan } from "react-scan";
export function Example() {
const form = useScan({ defaultValues: { email: "" } });
function onSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
console.log(form);
}
return (
<form onSubmit={onSubmit}>
<input name="email" type="email" placeholder="you@example.com" />
<button type="submit">Submit</button>
</form>
);
}Pros & cons
Pros
- Actively maintained by Aiden Bai
- 727k weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~25 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 77 open issues on GitHub