Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation/example for SSR #607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ node_modules
junit
.shadow-cljs
coverage/

.clj-kondo/
.cpcache/
.lsp/.cache
7 changes: 7 additions & 0 deletions doc/ReactFeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ as properties into the React function component.
(react-dom/createPortal (r/as-element [:div "foo"]) el)))
```

## [Server-Side Rendering (SSR)](https://react.dev/reference/react-dom/server/renderToString)

```cljs
(reagent.dom.server/render-to-string
(reagent.core/as-element [main-component]))
```

## [Hydrate](https://reactjs.org/docs/react-dom.html#hydrate)

```cljs
Expand Down