docs: add demo for React hooks and context (#150)

This commit is contained in:
harttle
2019-10-08 21:50:59 +08:00
parent 3a7ddaa2c3
commit 7bae5bcb79
8 changed files with 84 additions and 5 deletions
+15
View File
@@ -0,0 +1,15 @@
import './ClickButton.css';
import React from 'react';
import { Context } from './Context';
export function ClickButton() {
return (
<Context.Consumer>
{context => (
<button onClick={context.count}>
Click Here!
</button>
)}
</Context.Consumer>
);
};