@mybricks/rxui
v1.0.87
Published
Responsive framework for React programing,like the Mobx but not only Mobx
Downloads
28
Maintainers
Keywords
Readme
@mybricks/rxui
Responsive framework for React programing,like the Mobx but not only Mobx
Usage
import {render, useObservable} from '@mybricks/rxui'
render(<App/>, document.querySelector('#containerDomId'))
function App() {
const obs = useObservable(class {
num: number = Math.random()
})
return (
<div>
{obs.num}
<button onClick={() => obs.num = Math.random()}>ChangeValue</button>
</div>
)
}
API
render
Type:
type Render = (
renderTarget: JSX | (() => JSX),
parentDom: HTMLElement,
callback?: Function
) => void
Demos:
import {render} from '@mybricks/rxui'
//1.Like reactDom's render
render(<SomCom/>, parentDom, callback)
//2.Factory function
render(()=><SomCom/>, parentDom, callback)