1.0.9 • Published 6 years ago

@framejs/renderer-react v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

@framejs/renderer-react

FrameJS rendererer for React.

Install

$ npm install @framejs/core @framejs/renderer-react react

Usage

import { CustomElement } from '@framejs/core';
import { withReact } from '@framejs/renderer-preact';
import React from 'react';

class ReactHello extends React.Component {
  render() {
    const { children, yell } = this.props;
    return <div>Hello, {yell ? <strong>{children}</strong> : children}!</div>;
  }
}

@CustomElement({
    tag: 'my-element'
})
class MyElement extends withReact(HTMLElement) {
    @Attribute() checked = true;

    render() {
        return <ReactHello yell={true}>ReactJS</ReactHello>
    }
}