@de-pa/react-dom
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

@de-pa/react-dom

This package serves as the entry point to the DOM for @de-pa/React. It is intended to be paired with the generic React package, which is shipped as @de-pa/react to npm. based on react-dom and add dependency injection pattern.

Installation

npm install @de-pa/react @de-pa/react-dom injection-js

Usage

In the browser

import { Component, IComponent, InjectionProvider } from '@de-pa/react';
import { render } from '@de-pa/react-dom';

class Service {
    method() {
        return 'hello world';
    }
}

@IComponent()
class App extends Component {
    constructor(public service: Service) {
        super()
    }
    render() {
        return <div>{this.service.method()}</div>
    }
}

render(<InjectionProvider providers={[Service]}><App /></InjectionProvider>,document.body)

API

@de-pa/react-dom

  • findDOMNode
  • render
  • unmountComponentAtNode

/@de-pa/react-dom/

    Package Sidebar

    Install

    npm i @de-pa/react-dom

    Weekly Downloads

    0

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    3.14 MB

    Total Files

    35

    Last publish

    Collaborators

    • wl843022618