@@ -16,7 +16,7 @@ const REACT_ON_RAILS_STORE_ATTRIBUTE = 'data-js-react-on-rails-store';
1616
1717function delegateToRenderer (
1818 componentObj : RegisteredComponent ,
19- props : Record < string , string > ,
19+ props : Record < string , unknown > ,
2020 railsContext : RailsContext ,
2121 domNodeId : string ,
2222 trace : boolean ,
@@ -81,7 +81,7 @@ class ComponentRenderer {
8181 // This must match lib/react_on_rails/helper.rb
8282 const name = el . getAttribute ( 'data-component-name' ) || '' ;
8383 const { domNodeId } = this ;
84- const props = el . textContent !== null ? JSON . parse ( el . textContent ) : { } ;
84+ const props = el . textContent !== null ? ( JSON . parse ( el . textContent ) as Record < string , unknown > ) : { } ;
8585 const trace = el . getAttribute ( 'data-trace' ) === 'true' ;
8686
8787 try {
@@ -183,15 +183,18 @@ class StoreRenderer {
183183 }
184184
185185 const name = storeDataElement . getAttribute ( REACT_ON_RAILS_STORE_ATTRIBUTE ) || '' ;
186- const props = storeDataElement . textContent !== null ? JSON . parse ( storeDataElement . textContent ) : { } ;
186+ const props =
187+ storeDataElement . textContent !== null
188+ ? ( JSON . parse ( storeDataElement . textContent ) as Record < string , unknown > )
189+ : { } ;
187190 this . hydratePromise = this . hydrate ( context , railsContext , name , props ) ;
188191 }
189192
190193 private async hydrate (
191194 context : Context ,
192195 railsContext : RailsContext ,
193196 name : string ,
194- props : Record < string , string > ,
197+ props : Record < string , unknown > ,
195198 ) {
196199 const storeGenerator = await context . ReactOnRails . getOrWaitForStoreGenerator ( name ) ;
197200 if ( this . state === 'unmounted' ) {
0 commit comments