Are PropTypes still recommended in 2026?
PropTypes are considered a legacy runtime check — TypeScript is the recommended choice for new React code because it catches errors at compile time and provides editor autocomplete. PropTypes remain useful for plain-JavaScript codebases without a TypeScript build step, libraries that publish JS so consumers without TS still get prop validation in development, and incremental migration projects where types live in JSDoc.
Why generate PropTypes from JSON?
Most React components consume API responses as their props. Hand-writing PropTypes.shape({...}) for a 30-field user object is tedious; this tool walks the JSON sample and emits the matching shape with arrayOf, nested shapes, and isRequired in one step. Paste the API response, copy the PropTypes block straight into your component file.
Does the prop-types package still ship?
Yes — prop-types is maintained on npm and works with React 18 and React 19. React removed PropTypes from the core React package in 16.3 (so you have to install prop-types separately), but the package itself is stable and not deprecated. PropTypes checks run only in development; they are stripped from production builds by tools like webpack’s DefinePlugin.
How are nested objects handled?
Each nested object becomes a PropTypes.shape({...}) inline. The shape function takes a literal mapping of fieldName → PropTypes.X. Deeply nested objects produce nested shape() calls; the indentation is generated automatically. For shapes that you want to reuse across multiple components, extract the shape into a const sharedShape = PropTypes.shape({...}).
What about arrays of objects?
PropTypes.arrayOf(PropTypes.shape({...})) — the generator emits this automatically when it sees an array of objects. The shape is inferred from the first element. For mixed-type arrays use PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])) by hand.
Why is everything marked isRequired?
Because every key was present in the sample, the generator assumes the field is always required. If a prop is optional in your contract, drop the .isRequired suffix after pasting. PropTypes only warns in development when a required prop is missing — it does not block render.
Is the JSON uploaded to your servers?
No. Conversion runs entirely in your browser via JavaScript. Open DevTools → Network and click Convert — no requests are made. Pasting JSON containing tokens or proprietary data never leaves your machine.
Should I migrate to TypeScript instead?
For new components, yes — TypeScript catches errors before the code runs and gives editor autocomplete. PropTypes are best for libraries that ship JS, codebases without a TypeScript build pipeline, or as a first migration step. Generate both with our JSON-to-TypeScript tool and pick whichever fits your project.