import React, {useCallback} from 'react'; import ChildComponent from './ChildComponentExample'; import {useBind} from 'use-bind'; export interface IParentComponent { } const ParentComponent: React.FC = (props: IParentComponent) => { const myBind = useBind(1); const onClick = useCallback(() => { myBind.value += 10; }, [myBind]); return (
Click me will increase the value of the child component by 10 each time.
); } export default ParentComponent;