dyo / dyo

Dyo is a JavaScript library for building user interfaces.

Home Page:https://dyo.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ForwardRefs do not support defaultProps in DIO while in React they do

mcjazzyfunky opened this issue · comments

It would be nice if forwardRefs would support defaultProps as in React.

See the follwing demo:
https://jsfiddle.net/pr3gnsuj/

I'll have a look a this => assigned issue to myself

@thysultan I've evaluated that: It's basically for the same reason why forwardRefs do also not support propTypes yet (in branch issue76). It's three lines of code (plus unit tests). I'll fix that together with the "propType support for forwardRefs bug" in branch issue76, so there will not be a extra pull request for #81.

Yes, this is also related to Context, if we returned functions from those functions it would resolve itself.

Bugfix can be found here (branch "issue76"):

d0ade83#diff-a6b77a6eb2476ebcc9cb30d1be3aaa2aL523

Two new unit tests can be found here (branch "issue76"):

d0ade83#diff-cafcab72d15b5e55864154c33e3fec14R660

[Edit - a bit later]
As requested after review: Removed the above mentioned changes from branch "issue76" - to be added later in a dedicated pull request
90b8556