Skip to content

Broken 'home' link in the 'Xd' logo hyperlink #41

@EducatedStrikeCart

Description

@EducatedStrikeCart

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions