mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Adjust renderWithProvider to accommodate redux-less components (#10857)
This commit is contained in:
parent
8df7a712f3
commit
f7f1f28752
@ -43,11 +43,16 @@ export function mountWithRouter(component, store = {}, pathname = '/') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function renderWithProvider(component, store) {
|
export function renderWithProvider(component, store) {
|
||||||
const Wrapper = () => (
|
const Wrapper = () =>
|
||||||
<Provider store={store}>
|
store ? (
|
||||||
|
<Provider store={store}>
|
||||||
|
<MemoryRouter initialEntries={['/']} initialIndex={0}>
|
||||||
|
<LegacyI18nProvider>{component}</LegacyI18nProvider>
|
||||||
|
</MemoryRouter>
|
||||||
|
</Provider>
|
||||||
|
) : (
|
||||||
<LegacyI18nProvider>{component}</LegacyI18nProvider>
|
<LegacyI18nProvider>{component}</LegacyI18nProvider>
|
||||||
</Provider>
|
);
|
||||||
);
|
|
||||||
|
|
||||||
return render(<Wrapper />);
|
return render(<Wrapper />);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user