Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/unlucky-horses-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"eslint-config-thirdweb": patch
"@thirdweb-dev/react": patch
---

Enforce react-hooks/exhaustive-deps lint rule
3 changes: 3 additions & 0 deletions packages/eslint-config-thirdweb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ module.exports = {
],
},
],

// react
"react-hooks/exhaustive-deps": "error",
},
};
15 changes: 14 additions & 1 deletion packages/react/src/payments/components/CheckoutWithCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,20 @@ export const CheckoutWithCard = ({
options,
configs,
});
}, [CheckoutWithCardIframeContainerRef.current]);
}, [
appNameToUse,
clientId,
configs,
locale,
onBeforeModalOpen,
onCardDetailLoad,
onError,
onPaymentSuccess,
onPriceUpdate,
onReview,
options,
sdkClientSecret,
Comment on lines +101 to +112
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one needs a deeper look

]);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/payments/components/PaperCheckout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const PaperCheckout = <T extends ContractType>({
return () => {
window.removeEventListener("message", handleMessage);
};
}, []);
}, [onCloseCheckout, onPaymentSuccess, onTransferSuccess]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is fine


// Build iframe URL with query params.
const checkoutUrl = new URL(`/checkout/${checkoutId}`, PAPER_APP_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const VerifyOwnershipWithPaper: React.FC<
return () => {
window.removeEventListener("message", handleMessage);
};
}, []);
}, [onError, onSuccess, onWindowClose]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is fine


const url = new URL("/sdk/v1/login-with-paper", PAPER_APP_URL);
url.searchParams.append("chainName", chainNameToUse);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/payments/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Modal: React.FC<{
return () => {
document.removeEventListener("keydown", keyDownHandler);
};
}, []);
}, [escapeToClose, onClose]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is fine


const additionalDialogClasses = isFullScreen ? "" : dialogContainedClasses;
const dialogPanelBg = isFullScreen ? "transparent" : bgColor;
Expand Down