Skip to content

Commit

Permalink
remove unnecessary .Provider as React19 doesnt require it
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharqiewicz committed Jan 30, 2025
1 parent 0af3282 commit ef020bd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/GlobalStateProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const GlobalStateProvider = ({ children }: { children: JSX.Element }) => {
[dAppName, getThemeName, removeWalletAccount, setWalletAccount, tenantName, walletAccount],
);

return <GlobalStateContext.Provider value={providerValue}>{children}</GlobalStateContext.Provider>;
return <GlobalStateContext value={providerValue}>{children}</GlobalStateContext>;
};

const useGlobalState = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/NodeInfoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const NodeInfoProvider = ({ children, tenantRPC }: { children: React.ReactNode;
}
}, [currentTenantRPC, tenantRPC, pendingInitiationPromise, setPendingInitiationPromise]);

return <NodeInfoContext.Provider value={{ state, setState }}>{children}</NodeInfoContext.Provider>;
return <NodeInfoContext value={{ state, setState }}>{children}</NodeInfoContext>;
};

const useNodeInfoState = () => useContext(NodeInfoContext);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/spacewalk/bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Bridge() {
const bridgeDirection = tabValue === BridgeTabs.Issue ? BridgeDirection.Issue : BridgeDirection.Redeem;

return chain ? (
<BridgeContext.Provider
<BridgeContext
value={{
selectedAsset,
setSelectedAsset,
Expand All @@ -86,18 +86,18 @@ function Bridge() {
setExtendedVaults,
}}
>
<div className="flex items-center justify-center mt-4">
<div className="mt-4 flex items-center justify-center">
<SettingsDialog
visible={settingsVisible}
onClose={() => setSettingsVisible(false)}
bridgeDirection={bridgeDirection}
/>
<Card className="bridge-card min-h-500 w-full max-w-[520px] rounded-lg bg-base-200">
<div className="flex justify-between px-5 mt-5">
<div className="mt-5 flex justify-between px-5">
<SpacewalkTabs activeTab={tabValue} setActiveTab={setTabValue} />
<Button
color="ghost"
className="min-h-0 p-1 m-auto settings h-fit"
className="settings m-auto h-fit min-h-0 p-1"
onClick={() => setSettingsVisible(true)}
>
<SettingsIcon />
Expand All @@ -106,7 +106,7 @@ function Bridge() {
{Content}
</Card>
</div>
</BridgeContext.Provider>
</BridgeContext>
) : (
<></>
);
Expand Down
6 changes: 3 additions & 3 deletions src/services/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const ModalProvider = ({ children }: ModalProviderProps): JSX.Element | null =>
}, []);

return (
<ModalStateContext.Provider value={state}>
<ModalToggleContext.Provider value={toggleModal}>{children}</ModalToggleContext.Provider>
</ModalStateContext.Provider>
<ModalStateContext value={state}>
<ModalToggleContext value={toggleModal}>{children}</ModalToggleContext>
</ModalStateContext>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/shared/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SharedStateProvider = ({ children, api, signer, address }: { childr
}),
[api, signer, address],
);
return <SharedStateContext.Provider value={providerValue}>{children}</SharedStateContext.Provider>;
return <SharedStateContext value={providerValue}>{children}</SharedStateContext>;
};

export const useSharedState = () => {
Expand Down

0 comments on commit ef020bd

Please sign in to comment.