Our great sponsors
-
react-docgen
A CLI and library to extract information from React component files for documentation generation purposes.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
It’s possible, assuming you’ve typed your props using TS (maybe proptypes would work too, not sure) you can then use ReactDocGen (https://react-docgen.dev/) to have the types output in a way you can read them in code.
Someone mentioned developing a schema below. I wanted to throw out the Zod library as something that could help with this: https://github.com/colinhacks/zod
Well, you can, but there is a caveat... You would need to use a custom TS transformer. There is one that goes kinda half way to what you need: https://github.com/kimamula/ts-transformer-keys
Related posts
- Aleph.js – Fullstack Framework in Deno
- From Flaky to Flawless: Angular API Response Management with Zod
- TypeScript Essentials: Distinguishing Types with Branding
- You can’t run away from runtime errors using TypeScript
- Epic Next JS 14 Tutorial Part 4: How To Handle Login And Authentication in Next.js