-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fix/is 276 toast rerender #1333
Conversation
@@ -12,7 +12,7 @@ const retrieveThirdNavOptions = async ( | |||
collectionName, | |||
isExistingCollection | |||
) => { | |||
const errorToast = useErrorToast | |||
const errorToast = useErrorToast() |
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.
huh so this never worked :sadge:
export const useErrorToast = (): UseToastReturn => | ||
useToast({ | ||
// Not specifying return type because type is in the argument | ||
const useIsomerToast = (args: UseToastProps) => { |
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.
wah I think we need to define a return type here, but fell into a rabbit hole for this cuz we got a version mismatch between chakra and design system.
specifically, danger
doesnt exist anymore, should be error
now, but design system is lagging behind, actually not sure if this is already a bug in prod :sadge:
Rather than putting this, could you create a ticket and assign it to me? is related to the design system changes
This pull request has been stale for more than 30 days! Could someone please take a look at it @isomerpages/iso-engineers |
This PR fixes an issue with multiple rerenders of the toast components - the behaviour of react-hook-form and react-query seem to have changed after our dependencies update, and this caused issues for all of our toasts which were contained within
useEffect
, as the component would get rerendered, which changed the reference totoast
and triggered the useEffect again.The solution to this issue is to modify the toasts to use the
id
param - this prevents duplicate toasts from appearing (link). The components which make use of toasts have been modified to support this.Also resolves IS-284 once the privatisation PR has been rebased onto this one.