Skip to content

wmzy/use-with

Repository files navigation

Build Status Coverage Status install size

use-with

React Hooks HOC.

Install

npm install use-with

Usage

import * as React from 'react';
import useWith from 'use-with';
import Hello from './Hello';

export default function Demo({className}) {
  const HelloWorld = useWith(Hello, {className, message: 'World'});

  return <>
    <HelloWorld />
    <HelloWorld />
    <HelloWorld />
    <HelloWorld className="last" />
  </>;
}

Workflow

# develop
npm start

# build
npm run build

# test
npm test

# commit changes
npm run commit

# publish
npm publish