How do I include a React app? We are moving towards a hybrid-headless model with Drupal 7. All our data is exposed through RESTful and I have successfully built React app using the data. 

How can pull that app in as a block? I put the code in a block and the app loses much of its styling and 1 third of the data is hidden. The basic functionality still works, but that's not enough.  

Is there some trick to getting the a the full app to run correctly in a block? 

Thank you
I solved this as follows:


install react-app-rewired:  npm i --D react-app-rewired -- 
this is important so you don't try to load react more than once
change package.json so build executes react-app-rewired build -- full instructions here: https://github.com/timarney/react-app-rewired
Pick a spot in your Drupal install for your react app  -- I chose sites/all/react, it seemed right to me
load react into your template using the CDN links https://reactjs.org/docs/cdn-links.html
update package.json with homepage for your app to reflect where you are saving it for example: "homepage": "/sites/all/libraries/myapp/",
build your react app and copy the contents of the build folder to the location you chose for storing your app
build a simple module to load your app as a block (code below)
add the block to your page however you see fit  



/* Adds the block to the block menu */
function my_app_block_info() {
  $blocks['my_react_app'] = array( //a new array for each new app
    'info' => t('My React App'),
    'cache' => DRUPAL_NO_CACHE,
  );

  return $blocks;
}


/* set the content for the block */


function my_app_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'my_react_app': //a new case for each new app 
        $block['content'] = file_get_contents(libraries_get_path('appfolder').'/index.html');

        break;
     }
  return $block;
}


 /* 
   file_get_contents loads the index.html page that loads 
   the react app don't use libraries_get_path if you saved your app 
   somewhere else
 */