Skip to content

Commit d392735

Browse files
Docs: Add missing calls to Html.ReactInitJavaScript
This has caused a lot of confusion, since omitting this call will result in components that are not interactive
1 parent fd2b59e commit d392735

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

site/jekyll/getting-started/aspnet.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ namespace React.Sample.Mvc4
4343
}
4444
```
4545

46-
Reference JSX files directly in script tags:
46+
Reference JSX files directly in script tags at the end of the page:
4747

4848
```html
4949
<script src="~/Content/Sample.jsx"></script>
50+
@Html.ReactInitJavaScript();
5051
```
5152

5253
You're done! You can now call `Html.React` from within Razor files:

site/jekyll/getting-started/aspnetcore.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ Finally, add this to `Views\_ViewImports.cshtml` (or create it if it doesn't exi
7575
@using React.AspNet
7676
```
7777

78-
Reference JSX files directly in script tags:
78+
Reference JSX files directly in script tags at the end of the page:
7979

8080
```html
8181
<script src="~/Content/Sample.jsx"></script>
82+
@Html.ReactInitJavaScript();
8283
```
8384

8485
You're done! You can now call `Html.React` from within Razor files:

0 commit comments

Comments
 (0)