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
1 change: 1 addition & 0 deletions packages/react-paypal-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"lint": "eslint .",
"prepack": "rimraf dist && npm run build && npm run type-declarations",
"test": "jest --env=jsdom",
"test:watch": "jest --env=jsdom --watch",
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Choose a reason for hiding this comment

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

Ahh nice improvement!

"start": "npm run check-node-version && npm run storybook",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-paypal-js/src/hooks/useProxyProps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { useRef } from "react";

/**
* `useProxyProps` can be used to maintain a reference to an updated props, without that change triggering
* another re-render. This is useful if, for example, some props should be passed through a parent component to
* a child function that contains code that needs the most up-to-date-reference, without causing the parent to
* rerender.
*/
export function useProxyProps<T extends Record<PropertyKey, unknown>>(
props: T,
): T {
Expand Down
Loading
Loading