Skip to content

Commit b9ca7d4

Browse files
authored
Expand Typescript support section
Recommend setting the `server_renderer_extensions` config option.
1 parent 344ba13 commit b9ca7d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ $ bundle exec rails webpacker:install:typescript
172172
$ yarn add @types/react @types/react-dom
173173
```
174174

175-
Doing this will allow React-Rails to support the .tsx extension.
175+
Doing this will allow React-Rails to support the .tsx extension. Additionally, it is recommended to add `ts` and `tsx` to the `server_renderer_extensions` in your application configuration:
176+
```
177+
config.react.server_renderer_extensions = ["jsx", "js", "tsx", "ts"]
178+
```
176179

177180
### Test component
178181

0 commit comments

Comments
 (0)