Skip to content

add props getter to the Component class #12

@one-more

Description

@one-more

There should be universal mechanism to get component's props:

in markup:

<x-clock id="clock" data-type="digital" ></x-clock>

in code:

import {Component} from '@micro-frontends/core'

export class XClock extends Component {
    static getName() {
        return 'x-clock'
    }

    render() {
        const id = this.props.id;
        if (this.props.type == 'digital') {
            //render digital clock
        } else {
            //render analog clock
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions