### Create and Run a New Motion App Source: https://context7.com/steelbrain/motion/llms.txt Use 'motion new app' to scaffold a new project, 'cd' into it, and then run 'motion' to start the development server. ```bash # Create a new Motion application motion new app my-project # Navigate to the project directory cd my-project # Start the development server motion ``` -------------------------------- ### React Entry Point with Hot Module Replacement Source: https://context7.com/steelbrain/motion/llms.txt Set up your main React entry point to render the application and enable hot module replacement for development. Ensure 'module.hot' is available. ```javascript import React from 'react' import ReactDOM from 'react-dom' import Main from './main' if (typeof Main === '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() } ``` -------------------------------- ### Configure Application Entry Point in package.json Source: https://context7.com/steelbrain/motion/llms.txt Specify the main entry point for your Motion application in the 'main' field of your package.json. Falls back to 'index.js' if not provided. ```json { "name": "my-motion-app", "version": "1.0.0", "main": "src/index.js" } ``` -------------------------------- ### Main React Component Module Source: https://context7.com/steelbrain/motion/llms.txt Define your main React component in a separate file (e.g., main.js) for better organization and to ensure it works with hot reloading. ```javascript // main.js import React from 'react' export default function Main() { return (
Your JavaScript application is running!