rails g react:component HelloTypescript --ts
Running via Spring preloader in process 1234
create app/javascript/components/HelloTypescript.ts(x)
Running via Spring preloader in process 1234
create app/javascript/components/HelloTypescript.js
When I have run bundle exec rails webpacker:install:typescript or when I specify --ts after the generate react:component, I'd like it to create a Typescript component instead of a JS one. (I see there is a --coffee flag too, so a --ts flag would be nice)
@richarddewit I've not used Typescript before, but it's clearly popular and pretty widely supported by major players already so we would welcome a PR if you're able to do so.
https://github.com/reactjs/react-rails/tree/master/lib/generators/templates
The templates for the generators are in this folder, so anyone implementing would only need to provide a template and then add it to the component generator here:
https://github.com/reactjs/react-rails/blob/master/lib/generators/react/component_generator.rb#L92
Thank you!
@richarddewit could you please give #990 a try.
@BookOfGreg I'd appreciate any feedback for #990.
Most helpful comment
@richarddewit could you please give #990 a try.
@BookOfGreg I'd appreciate any feedback for #990.