11import React , { useReducer } from 'react' ;
22import hoistNonReactStatics from 'hoist-non-react-statics' ;
3- import merge from 'lodash.merge ' ;
3+ import extend from 'just-extend ' ;
44import { IntlProvider } from 'react-intl' ;
55import { GasketIntlContext } from './context' ;
66import { clientData , isBrowser } from './config' ;
@@ -17,7 +17,7 @@ export function init(localesProps) {
1717 if ( isBrowser ) {
1818 // merge any data set on window with what comes from SSR or static page props
1919 const { messages : dataMessages = { } , status : dataStatus = { } } = clientData ;
20- return merge ( { } , { messages : dataMessages , status : dataStatus } , { messages, status } ) ;
20+ return extend ( true , { } , { messages : dataMessages , status : dataStatus } , { messages, status } ) ;
2121 }
2222
2323 return { messages, status } ;
@@ -89,7 +89,7 @@ export default function withIntlProvider() {
8989 // If we have incoming pageProps, we need to update state but have to by
9090 // mutation rather than issuing a dispatch to avoid re-renders and timing issues
9191 if ( localesProps ) {
92- merge ( state , localesProps ) ;
92+ extend ( true , state , localesProps ) ;
9393 }
9494
9595 const locale = localesProps ?. locale ||
0 commit comments