- Source:
Methods
-
<inner> createComponent(PassedComponent [, options])
-
create a simple component where props are rendered
Parameters:
Name Type Argument Default Description PassedComponent
Component | function component to wrap
options
Object <optional>
{} options to apply to the HOC created by arco
- Source:
Returns:
- Type
- Component | function
Example
import createComponent from 'arco'; const OPTIONS = { onButtonClick() { alert('hello!'); } }; const Foo = ({onButtonClick}) => { return ( <button onClick={onButtonClick} type="button" > Click me! </button> ); }; export default createComponent(Foo, OPTIONS);