You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 31, 2018. It is now read-only.
Steel Brain edited this page May 13, 2016
·
1 revision
There are several important changes in this version, some of them are
Instead of always requiring $root/index.js, it now reads the $root/package.json and tries to load the file mentioned in the main field, still falls back to $root/index.js if no main is specified or manifest doesn't exist
Instead of handling the rendering of the app magically, it now lets users choose how an app is rendered; giving you the full control over your app.
motion new app now creates an app with the new and recommended structure
Migration to the new version is easy, simply rename your current index.js to main.js and paste this in a new file and save it as index.js.
importReactfrom'react'importReactDOMfrom'react-dom'importMainfrom'./main'if(typeofMain==='function'){ReactDOM.render(React.createElement(Main),document.getElementById('app'))}else{console.error('No default view exported from the main file')}if(process.env.NODE_ENV==='development'&&module.hot){module.hot.accept()}