base-context-provider/example/src/Button.tsx
2020-07-14 16:04:58 +07:00

16 lines
351 B
TypeScript

import React from 'react'
import { useTestContext, withTestContext } from './TestContext'
const Button = (props: any) => {
const {punishmentLevel} = props.testContextProps
const { heat }: any = useTestContext()
return (
<div>
heat: {heat} <br/>
levels: {punishmentLevel}
</div>
)
}
export default withTestContext(Button)