Closed KyleAMathews closed 9 years ago
Would we need to determine if the given module contains a React.render()
call (¯\_(ツ)_/¯ - "indexOf"
) or is exporting a component ((╯°□°)╯︵ ┻━┻)
for a non-hacky check) first, or just assume that if there's no React.render()
call that it exports a component?
I have a stupid simple implementation of this for 1.2 :+1:
My thought was you call heatpack app.jsx
This app.jsx
gets passed as a string to the root component which requires it and then calls React.render using the required component. So anything you pass to heatpack must export a React component.
To make this even slicker, why not ship a root component with react-heatpack which auto-requires the entry component passed in from the command line?
This would also help noobs avoid this common hot-loading problem https://github.com/gaearon/react-hot-loader/blob/master/docs/Troubleshooting.md#the-following-modules-couldnt-be-hot-updated-they-would-need-a-full-reload