diff --git a/desktop/flipper-plugin/src/ui/__tests__/useLocalStorage.node.tsx b/desktop/flipper-plugin/src/ui/__tests__/useLocalStorage.node.tsx index c38f7bfb8..277bcd2b0 100644 --- a/desktop/flipper-plugin/src/ui/__tests__/useLocalStorage.node.tsx +++ b/desktop/flipper-plugin/src/ui/__tests__/useLocalStorage.node.tsx @@ -102,6 +102,6 @@ test('it does not allow changing key', async () => { console.error = orig; } }).toThrowErrorMatchingInlineSnapshot( - `"[useAssertStableRef] An unstable reference was passed to this component as property 'key'. For optimization purposes we expect that this prop doesn't change over time. You might want to create the value passed to this prop outside the render closure, store it in useCallback / useMemo / useState, or set a key on the parent component"`, + `"[useAssertStableRef] An unstable reference was passed to this component as property 'key'. For optimization purposes we expect that this prop doesn't change over time. You might want to create the value passed to this prop outside the render closure, store it in useCallback / useMemo / useState, or set a key on the parent component. Prev value: x. New value: y"`, ); }); diff --git a/desktop/flipper-plugin/src/utils/useAssertStableRef.tsx b/desktop/flipper-plugin/src/utils/useAssertStableRef.tsx index c52e2088c..7f42ee023 100644 --- a/desktop/flipper-plugin/src/utils/useAssertStableRef.tsx +++ b/desktop/flipper-plugin/src/utils/useAssertStableRef.tsx @@ -20,7 +20,7 @@ export const useAssertStableRef = !isProduction() const ref = useRef(value); if (ref.current !== value) { throw new Error( - `[useAssertStableRef] An unstable reference was passed to this component as property '${prop}'. For optimization purposes we expect that this prop doesn't change over time. You might want to create the value passed to this prop outside the render closure, store it in useCallback / useMemo / useState, or set a key on the parent component`, + `[useAssertStableRef] An unstable reference was passed to this component as property '${prop}'. For optimization purposes we expect that this prop doesn't change over time. You might want to create the value passed to this prop outside the render closure, store it in useCallback / useMemo / useState, or set a key on the parent component. Prev value: ${ref.current}. New value: ${value}`, ); } }