File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ if (typeof use !== 'function') {
1717
1818declare global {
1919 interface Window {
20- __FLIGHT_DATA : unknown [ ] ;
20+ REACT_ON_RAILS_RSC_PAYLOAD : unknown [ ] ;
2121 }
2222}
2323
@@ -53,11 +53,11 @@ const createRSCStreamFromPage = () => {
5353 const handleChunk = ( chunk : unknown ) => {
5454 controller . enqueue ( chunk as RSCPayloadChunk ) ;
5555 } ;
56- if ( ! window . __FLIGHT_DATA ) {
57- window . __FLIGHT_DATA = [ ] ;
56+ if ( ! window . REACT_ON_RAILS_RSC_PAYLOAD ) {
57+ window . REACT_ON_RAILS_RSC_PAYLOAD = [ ] ;
5858 }
59- window . __FLIGHT_DATA . forEach ( handleChunk ) ;
60- window . __FLIGHT_DATA . push = ( ...chunks : unknown [ ] ) => {
59+ window . REACT_ON_RAILS_RSC_PAYLOAD . forEach ( handleChunk ) ;
60+ window . REACT_ON_RAILS_RSC_PAYLOAD . push = ( ...chunks : unknown [ ] ) => {
6161 chunks . forEach ( handleChunk ) ;
6262 return chunks . length ;
6363 } ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const RSCPayloadContainer = ({
2727
2828 const scriptElement = React . createElement ( 'script' , {
2929 dangerouslySetInnerHTML : {
30- __html : escapeScript ( `(self.__FLIGHT_DATA ||=[]).push(${ chunk . chunk } )` ) ,
30+ __html : escapeScript ( `(self.REACT_ON_RAILS_RSC_PAYLOAD ||=[]).push(${ chunk . chunk } )` ) ,
3131 } ,
3232 key : `script-${ chunkIndex } ` ,
3333 } ) ;
You can’t perform that action at this time.
0 commit comments