-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/MSSDK-2126: Create Primer component without backend integration #457
feat/MSSDK-2126: Create Primer component without backend integration #457
Conversation
src/components/UpdatePaymentDetailsPopup/UpdatePaymentDetailsPopup.jsx
Outdated
Show resolved
Hide resolved
@@ -267,6 +267,15 @@ const UpdatePaymentDetailsPopup = () => { | |||
const showPayPalWhenAdyenIsReady = () => | |||
shouldShowAdyen ? !!dropInInstance : true; | |||
|
|||
const adyenProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could inline this, no need to keep another variable in the memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it looks bad when inlined but sure, can inline it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just noticed - i don't think this should be an object. this object will be re-created on each render, causing rerenders down the line
if you pass the props as separate props, the rerender will happen only if any of them changes
src/hooks/usePaymentDropIn.tsx
Outdated
@@ -0,0 +1,31 @@ | |||
import { lazy } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the src/hooks
directory is meant to hold only context-agnostic, reusable hooks. this one is very context-specific, as it is used in only one component. please move it next to the component
The general rule is that a file should be placed in a location that is the "smallest" common parent location for all the other files that use it
|
c1b28e6
into
feat/MSSDK-2064-psp-routing-primer-connector-phase-1
Description
To introduce a
Primer
component similar to the existingAdyen
component in the project. Import it using lazy loading. The component will import and initialize@primer-io/checkout-web
but will not be integrated with the backend, resulting in an expected error.