Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

devongovett
Copy link
Member

This fixes two issues using Toast in Next.js

  1. use-sync-external-store doesn't have package.json exports, so it doesn't work in ESM. I filed a PR here to fix it Add package.json exports for use-sync-external-store facebook/react#26230 but for now we can import explicitly from use-sync-external-store/shim/index.js.
  2. useSyncExternalStore has an "optional" third argument called getServerSnapshot which isn't really optional because it errors if it isn't provided on the server. So now I have implemented it. Also added SSR tests to catch this.

@rspbot
Copy link

rspbot commented Feb 24, 2023

@rspbot
Copy link

rspbot commented Feb 24, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM, verified that the example app renders the toast properly versus the previous behavior where it fails during build with the Did you mean to import use-sync-external-store/shim/index.js? error

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM

@devongovett devongovett merged commit b4626a2 into main Feb 28, 2023
@devongovett devongovett deleted the toast-ssr branch February 28, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants