You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A complex example of how to do server-side rendering with
10
14
[React](http://facebook.github.io/react/) and [TypeScript](https://www.typescriptlang.org/) so that component code can be shared between server and browser (also known as isomorphic javascript).
11
15
@@ -25,6 +29,14 @@ npm start
25
29
26
30
Then navigate to http://localhost:3007 and click on the buttons to see some reactive events in action.
27
31
32
+
## Deployment
33
+
34
+
You can deploy with `now` by doing something like the following:
35
+
36
+
```sh
37
+
npx now -e NODE_ENV=production styfle/react-server-example-tsx
38
+
```
39
+
28
40
## Preventing XSS
29
41
30
42
The original code from `mhart` attempts to [sanitize the props](https://github.com/mhart/react-server-example/blob/feada6183fe2fbb1a746492e157febe49eeafdcd/server.js#L106) by escaping and then inserting into a `<script>` tag.
0 commit comments