mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-05-01 02:46:21 +00:00
Do not inject servers state or actions
This commit is contained in:
@@ -19,10 +19,11 @@ export const renderWithStore = (
|
||||
element: ReactElement,
|
||||
{ initialState = {}, ...options }: RenderOptionsWithState = {},
|
||||
) => {
|
||||
const Wrapper = ({ children }: PropsWithChildren) => (
|
||||
<Provider store={setUpStore(initialState)}>
|
||||
{children}
|
||||
</Provider>
|
||||
);
|
||||
return renderWithEvents(element, { ...options, wrapper: Wrapper });
|
||||
const store = setUpStore(initialState);
|
||||
const Wrapper = ({ children }: PropsWithChildren) => <Provider store={store}>{children}</Provider>;
|
||||
|
||||
return {
|
||||
store,
|
||||
...renderWithEvents(element, { ...options, wrapper: Wrapper }),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user