oh I seem to have figured it out!
// core/headless.php
if( AM_REQUEST == '/data.json' ){
return AM_BASE_DIR . AM_HEADLESS_TEMPLATE;
}
// react.php hold template file with js and react router
return AM_BASE_DIR . '/react.php';
is this worth making a PR for? (like to add to config/config.json instead of hardcoding)