mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-19 21:28:26 +02:00
fix: Rename use-auth.js to use-auth.jsx for JSX support
This commit is contained in:
2875 files changed
+459559
-2
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
import { createElement } from 'react';
|
||||
import { useSSR } from './useSSR.js';
|
||||
import { composeInitialProps } from './context.js';
|
||||
import { getDisplayName } from './utils.js';
|
||||
|
||||
export const withSSR = () =>
|
||||
function Extend(WrappedComponent) {
|
||||
function I18nextWithSSR({ initialI18nStore, initialLanguage, ...rest }) {
|
||||
useSSR(initialI18nStore, initialLanguage);
|
||||
|
||||
return createElement(WrappedComponent, {
|
||||
...rest,
|
||||
});
|
||||
}
|
||||
|
||||
I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);
|
||||
I18nextWithSSR.displayName = `withI18nextSSR(${getDisplayName(WrappedComponent)})`;
|
||||
I18nextWithSSR.WrappedComponent = WrappedComponent;
|
||||
|
||||
return I18nextWithSSR;
|
||||
};
|
||||
Reference in new issue
Block a user