import React, {useCallback} from 'react'; import {IBind} from 'use-bind'; export interface IChildComponent { myBind: IBind } const ChildComponent: React.FC = ({ myBind }: IChildComponent) => { const onClick = useCallback(() => { myBind.value += 1; }, [myBind]); return (
Click me will increase the value of the child component itself by 1 each time.
Child Component Value: {myBind.value}
); } export default ChildComponent;