-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem:
The hyper link when you click on/hover over the 'Xd' logo of the header is rendered as https://adobexdplatform.com/[object Object]
Issue:
The prop for src\components\Header.jsx is being passed as an object and a const.
export default function Header({ items = [] } = {}, home ) {
...
}But since react expects props to be objects which it then destructures, it also treats home as an object and renders it as [object Object].
Fix:
Rewrite as :
export default function Header({items: { items = [] } = {}, home: home}) {
...
}Note: Header({items: { items = [] } = {}}, {home}) also works; it just looks bad
reference: pitfall, https://react.dev/learn/passing-props-to-a-component
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels