You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor!: rename widget ComponentPath to Component for consistency (#15780)
- Renames `Widget.ComponentPath` to `Widget.Component` and types it as
`PayloadComponent` instead of `string`
- This aligns dashboard widgets with every other component reference in
Payload (collections, globals, fields, admin components) - none of them
use _path_ in the property name, and all of them are typed as
`PayloadComponent`
- Enables new [typescript
plugin](#15779) to work for
widget paths (the plugin uses `PayloadComponent` contextual type
detection - `string`-typed properties were invisible to it)
## Breaking Change
`Widget.ComponentPath` has been renamed to `Widget.Component`.
### Migration
Find and replace in your Payload config:
```diff
widgets: [
{
slug: 'my-widget',
- ComponentPath: './components/MyWidget#MyWidget',
+ Component: './components/MyWidget#MyWidget',
},
]
```
0 commit comments