From 2bb9dcd63498230df5b754dcc97cb4b29f5975a9 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Tue, 17 May 2022 13:53:43 -0400 Subject: [PATCH] Clarify key ordering requirement See: https://github.com/18F/identity-idp/pull/6363#discussion_r875090737 Co-Authored-By: Zach Margolis --- app/javascript/packages/react-hooks/use-object-memo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/packages/react-hooks/use-object-memo.ts b/app/javascript/packages/react-hooks/use-object-memo.ts index ddfbe7290e2..703b2e82164 100644 --- a/app/javascript/packages/react-hooks/use-object-memo.ts +++ b/app/javascript/packages/react-hooks/use-object-memo.ts @@ -7,8 +7,8 @@ import { useMemo } from 'react'; * This can be useful in situations like object context values, since without memoization an object * context would trigger re-renders of all consumers on every update. * - * Note that the keys of the object must remain the same for the lifecycle of the component for the - * hook to work correctly. + * Note that the keys of the object (and their order) must remain the same for the lifecycle of the + * component for the hook to work correctly. * * @param object Object to memoize. *