Skip to content

Customer object from useMantle should be nullable #4

@edmondso006

Description

@edmondso006

Currently the customer object is defined as:

const customer: Customer
const { customer, loading } = useMantle();

However, the customer can be nullable when the customer is loading. This can lead to cannot read properties of null errors when attempting to grab data off of the customer. I think that it would be better if the type reflects this.

* @property {Customer|null} customer - The current customer

https://github.com/Hey-Mantle/react/blob/master/src/components/core/MantleProvider/MantleProvider.js#L225

Happy to open PR but I didn't see a contributing doc.

Anyways, great work Mantle team. I'm loving the product 🤝

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions