Skip to content

Commit 7a65962

Browse files
committed
Snake-Case key to Camel-Case key for props when server render
1 parent 3df85b0 commit 7a65962

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/react/server_rendering/sprockets_renderer.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ def after_render(component_name, props, prerender_options)
3939
def camelize_props_key(props)
4040
return props unless props.is_a?(Hash)
4141
props.inject({}) do |h, (k,v)|
42-
k = k.to_s.camelize(:lower)
43-
if v.is_a?(Hash)
44-
h[k] = camelize_props_key(v); h
45-
else
46-
h[k] = v; h
47-
end
42+
h[k.to_s.camelize(:lower)] = v.is_a?(Hash) ? camelize_props_key(v) : v; h
4843
end
4944
end
5045

0 commit comments

Comments
 (0)