DEV Community

Discussion on: A quick start guide to creating an app with Preact, TypeScript and Ruby on Rails

Collapse
 
_pinhaum profile image
Gabriel

Hi Emma!
Thanks for the amazing content!
I'm new to preact and I'm trying to learn it with rails, and I have a question for you
when you say "Make sure to update all of your JavaScript files to end with .ts and .tsx!", which files do you mean? and which are '.ts' or '.tsx'

again, thanks for the amazing content <3

Collapse
 
emma profile image
Emma Goto 🍙

You should see some sort of "hello world" files inside of app/javascript, and they might be initially created as a .js file. Since you're switching to using TypeScript, you'll need to update those files to get TypeScript to work properly.

If your code is rendering a Preact component you'll want it to end in .tsx, if you have a file that only has some functions (e.g. a util file) then you'll need .ts.

Hope that helps!