Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

defaultProps support for t.interface #276

Open
hexpunk opened this issue Apr 14, 2017 · 1 comment
Open

defaultProps support for t.interface #276

hexpunk opened this issue Apr 14, 2017 · 1 comment

Comments

@hexpunk
Copy link

hexpunk commented Apr 14, 2017

Version

3.2.20

Expected behaviour

t.interface to support defaultProps like t.struct does.

Actual behaviour

t.interface does not support defaultProps.

Steps to reproduce

const Wearable = t.interface({
  wearable: t.Boolean
}, {
  name: 'Wearable',
  defaultProps: {
    wearable: true
  }
});

const wearable = new Wearable({});

Stack trace and console log

Uncaught TypeError: [tcomb] Invalid value undefined supplied to Wearable/wearable: Boolean

@Download
Copy link

defaultProps support for structs was added in this commit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants