Skip to main content

App - Initialization

Installation

npm install refract-js

File Structure

my-app/
├── src/
│ ├── components/
│ ├── optics/
│ ├── app.js
│ └── index.js
└── package.json

Entry Point

import { createApp } from 'refract';
import { Counter } from './components/Counter';

createApp(Counter).mount('#root');
  • createApp(rootComponent)
    • Bootstraps the Refract application
    • Mounts to a DOM node
    • Handles refraction lifecycle