Skip to content

Schema.node does not allow a value of 'null' #4

@ddeklerk

Description

@ddeklerk

I could be missing something, but when a component does not have a child, null is passed instead. This means that a component without child will fail the propType validation when Schema.node is used.

For reference, this is the schema that I use.

Test.propTypes = propTypeSchema({
  type: 'object',
  properties: {
    children: {
      type: Schema.node,
      required: false,
    },
    route: {
      type: 'object',
    },
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions