Skip to content

Commit

Permalink
Deprecate render-to-str, explain how to DIY (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
holyjak authored Sep 24, 2023
1 parent 3a8944b commit 3d98f70
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 3d98f70

Please sign in to comment.