Skip to content

Commit 4a9a95c

Browse files
committed
docs
1 parent 44f19f6 commit 4a9a95c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

examples/frontend-rendering-with-webpack/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Running the example
22
===================
33

4+
As mentioned in the ***Using React on the front-end*** section, [Webpack](https://webpack.github.io/) is used to bundle the respective js files into `dist.js` and included in `index.html`. To make React attributes like `onClick` etc. work, the app has to be re-rendered (along with all the props passed down) when it loads on the browswer. React is intelligent enough to not re-paint the browser and only update the changes, thus adding all the component properties.
5+
46
Install the dependencies
57

68
```
@@ -23,7 +25,6 @@ python example.py
2325
And visit [http://127.0.0.1:5000](http://127.0.0.1:5000)
2426

2527
### Notes
26-
To make React attributes like `onClick` etc. work, the app has to be re-rendered when it loads on the browswer. React is intelligent enough to not re-paint the browser and only update the changes, thus adding all the component properties.
2728

2829

2930

examples/frontend-rendering-with-webpack/templates/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ <h1>Python + React example</h1>
1010
<div id="app-container">{{ rendered|safe }}</div>
1111
</div>
1212
<script>
13+
// Info stored for re-rendering the app
1314
var store = {{ store | tojson | safe }};
1415
</script>
1516
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js" type="text/javascript"></script>

0 commit comments

Comments
 (0)