0

I would like to generate Typescript React pages or components by using an API and not a CLI tool (like Plop.js) offers for example. The idea is to generate those components from templates based after a tool is run and it should happen behind the scenes without user interacting with the default CLI tools that they usually come in.

Thank you.

Ahmedie-m
  • 309
  • 1
  • 4
  • 13

2 Answers2

0

You can use http://json2ts.com/ for this issue. Or also there is package https://www.npmjs.com/package/json-to-ts

Abdulrahim Klis
  • 388
  • 3
  • 9
  • 1
    Thanks, this is cool but seems it only does interfaces, can’t really generate any functional React components with this. – Ahmedie-m Feb 15 '22 at 12:20
0

I have come across Hygen and used their setup that was noted down in the Readme to setup an API for generating custom components without interacting with any default CLI tools.

Ahmedie-m
  • 309
  • 1
  • 4
  • 13