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

Mark render-to-str deprecated, show how to do it yourself #547

Merged
merged 1 commit into from
Sep 24, 2023
Merged
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
10 changes: 8 additions & 2 deletions src/main/com/fulcrologic/fulcro/dom.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@
[component el]
(react.dom/render component el))

(defn render-to-str
"Equivalent to React.renderToString. NOTE: You must make sure js/ReactDOMServer is defined (e.g. require cljsjs.react.dom.server) to use this function."
(defn ^:deprecated render-to-str
"This fn is outdated - it expects js/ReactDOMServer to be defined (used to be provided cljsjs.react.dom.server).
It is better to do it yourself (under shadow-cljs):

```clj
(ns ex (:require [\"react-dom/server\" :as react-dom-server] ...))
(react-dom-server/renderToString c)
```"
[c]
(js/ReactDOMServer.renderToString c))

Expand Down