Skip to content

A declarative, efficient, and flexible JavaScript library for building user interfaces.

License

Notifications You must be signed in to change notification settings

John-Oldman-Wang/de-pa-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@de-pa/React is a JavaScript library for building user interfaces. Added dependency injection design pattern base on react.

Installation

npm i @de-pa/react @de-pa/react-dom injection-js reflect-metadata --save

Example Usage

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)

note

React has released two packages separately. It is very difficult to develop @de-pa/react based on react. So I think to develop a @de-pa/preact based on preact, welcome to use

License

@de-pa/React is MIT licensed.

About

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.1%
  • HTML 2.3%
  • CSS 1.2%
  • C++ 0.8%
  • TypeScript 0.4%
  • C 0.1%
  • Other 0.1%