Skip to content

Commit 487b111

Browse files
authored
Merge pull request #873 from iporollo/master
📝 Add Typescript integration details [ci skip]
2 parents 2084b92 + 3c60f9b commit 487b111

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ Component File Name | `react_component` call
127127
`app/javascript/components/SampleComponent.js` | `react_component("SampleComponent")`
128128
`app/javascript/components/SampleComponent.js.jsx` | Has to be renamed to SampleComponent.jsx, then use `react_component("SampleComponent")`
129129

130+
### Typescript support
131+
132+
If you want to use React-Rails with Typescript, simply run the installer and add @types:
133+
```
134+
$ bundle exec rails webpacker:install:typescript
135+
$ yarn add @types/react @types/react-dom
136+
```
137+
138+
Doing this will allow React-Rails to support the .tsx extension.
130139

131140
## Use with Asset Pipeline
132141

0 commit comments

Comments
 (0)