Skip to content

Commit

Permalink
chore: export toast from react toastify in payload (#8438)
Browse files Browse the repository at this point in the history
Export `toast` from `react-toastify` directly as to avoid situations
where there could be a module mismatch when trying to use `toast` in
custom components.

This will make toast usable from

```ts
import { toast } from 'payload/components/elements'
```
  • Loading branch information
paulpopus authored Sep 27, 2024
1 parent 800ffd2 commit 17fc2d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/payload/src/exports/components/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ export {
useListDrawer,
} from '../../admin/components/elements/ListDrawer'

export { useNav } from '../../admin/components/elements/Nav/context'

export { default as NavGroup } from '../../admin/components/elements/NavGroup'
export {
Description,
DescriptionComponent,
DescriptionFunction,
} from '../../admin/components/forms/FieldDescription/types'

export { useNav } from '../../admin/components/elements/Nav/context'
export { default as NavGroup } from '../../admin/components/elements/NavGroup'
export { toast } from 'react-toastify'

0 comments on commit 17fc2d1

Please sign in to comment.