This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ def force_update!
3131 end
3232
3333 def html
34- React . render_to_static_markup ( element )
34+ # How can we get the current ReactElement w/o violating private APIs?
35+ elem = Native ( native [ :_reactInternalInstance ] [ :_currentElement ] )
36+ React . render_to_static_markup ( elem )
3537 end
3638 end
3739 end
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ def render
6161 subject . mount ( Greeter , message : 'world' )
6262 expect ( subject . html ) . to eq ( '<span>Hello world</span>' )
6363 end
64+
65+ it 'returns the updated static html' do
66+ subject . mount ( Greeter )
67+ subject . update_params ( message : 'moon' )
68+ expect ( subject . html ) . to eq ( '<span>Hello moon</span>' )
69+ end
6470 end
6571
6672 describe '#update_params' do
You can’t perform that action at this time.
0 commit comments