npm.io
1.19.2 • Published 3 months ago

reshow-build

Licence
ISC
Version
1.19.2
Deps
2
Size
45 kB
Vulns
0
Weekly
0
Stars
4

Reshow Build

React cloneElement and createElement alternaive.

To help u build anything.

Usage

Build without instance

import build from "reshow-build";
import YourComponent from "./YourComponent";

const Comp = props => 
 build(YourComponent)(props, children /* optioninal*/ )
Build with instance
import build from "reshow-build";
import YourComponent from "./YourComponent";

const Comp = props => 
 build(<YourComponent />)(props, children /* optioninal*/ )
Build with array
import build from "reshow-build";
import YourComponent from "./YourComponent";

const Comp = props => 
 build([
    <YourComponent />,
    YourComponent,
    () => <YourComponent />,
    'div',
    'just string'
 ])(props, children /* optioninal*/ )

More examples

Examples

Keywords