You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not suitable for ReactJS props, which is expected to be a key-value object. You will need to wrap your index.json.jbuilder node with a root node, like so:
React components can also use the same ExecJS mechanisms in Sprockets to execute JavaScript code on the server, and render React components to HTML to be delivered to the browser, and then the `react_ujs` script will cause the component to be mounted. In this way, users get fast initial page loads and search-engine-friendly pages.
test'Rendering does not throw an exception when console log api is used'do
12
22
%W(errorinfologwarn).eachdo |fn|
13
23
assert_nothing_raised(ExecJS::ProgramError)do
@@ -23,4 +33,17 @@ class ReactRendererTest < ActiveSupport::TestCase
23
33
expected_message='Encountered error "ReferenceError: NonexistentComponent is not defined" when prerendering NonexistentComponent with {"error":true,"exists":false}'
24
34
assert_equalexpected_message,err.message
25
35
end
36
+
37
+
test'prerender errors are thrown when given a string'do
expected_message='Encountered error "ReferenceError: NonexistentComponent is not defined" when prerendering NonexistentComponent with {"error":true,"exists":false}'
0 commit comments