Skip to content

TypeError: Cannot read property 'viewer' of undefined. #30

Open
@ma-nish

Description

@ma-nish

When component did mount, there is no value in { data } returned from component. So, it generates a TypeError: Cannot read property 'viewer' of undefined.

const Profile = () => (

{({ data, loading }) => {
const { viewer } = data;
if (loading || !viewer) {
return

Loading ...
;
}
return (

{viewer.name} {viewer.login}

)
}}

);

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