Как передать данные из скрипта root html в компоненты дочернего уровня - PullRequest
0 голосов
/ 22 апреля 2020

Как получить доступ к данным, доступным на сценарии root level html в реагирующих дочерних компонентах?

  • root. html

    <html>
       <head> 
        <script type="text/javascript">           
          function DataIntoComponents()    
          {            
            var message = 'Some Data';
            //How to pass this message into the components   
          }             
      </script> 
    </head>
    <body>
    <div id='root'></div>
    </body>
    </html>  
    
  • index.tsx

    componentDidMount{
     //How to access message here ??
    }
    
...