Props

Where do I define default component props?

Inside the created() life cycle hook.

import { Component } from "combo-js";

const Example = new class extends Component {
    created() {
        this.props = {
            name: "world"
        }
    }
    render() {
        return `
            <div>Hello ${this.props.name}</div>
        `;
    }
}();

Example.mount(document.getElementById("root"));

How do I pass props to a mounted component?

Pass them through the mount() method.

How do I pass props to an unmounted component?

Pass them through the constructor function.

Can I manipulate props?

You can manipulate props in the receiving() life cycle method.

Last updated