From 65f8915dc1099b0bd03c9c6bcebaf5997c0ba91c Mon Sep 17 00:00:00 2001 From: Jerko Steiner Date: Thu, 5 Sep 2019 13:07:26 +0700 Subject: [PATCH] Add useCallback when testing FunctionalComponent --- packages/client/src/redux/pack.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/redux/pack.test.tsx b/packages/client/src/redux/pack.test.tsx index 98930ac..ac08f93 100644 --- a/packages/client/src/redux/pack.test.tsx +++ b/packages/client/src/redux/pack.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useCallback } from 'react' import ReactDOM from 'react-dom' import { Provider } from 'react-redux' import { createStore, Dispatch } from 'redux' @@ -34,8 +34,10 @@ describe('pack', () => { } function FunctionalComponent(props: IProps) { + const update = useCallback(() => props.update(1, 'one'), []) + return ( - )