Skip to content

Instantly share code, notes, and snippets.

@jrwebdev
Last active June 3, 2018 01:43
Show Gist options
  • Select an option

  • Save jrwebdev/d45203f8d9e04d4c4fa5eaa26328afdb to your computer and use it in GitHub Desktop.

Select an option

Save jrwebdev/d45203f8d9e04d4c4fa5eaa26328afdb to your computer and use it in GitHub Desktop.
interface CounterProps {
style: React.CSSProperties;
minValue?: number;
maxValue?: number;
}
const Counter = (props: CounterProps) => (
<MakeCounter minValue={props.minValue} maxValue={props.maxValue}>
{injectedProps => (
<div style={props.style}>
<button onClick={injectedProps.onDecrement}> - </button>
{injectedProps.value}
<button onClick={injectedProps.onIncrement}> + </button>
</div>
)}
</MakeCounter>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment