willowtreeapps / react-formable

React Forms
25 stars 5 forks source link

Adds warning for badly named components #97

Closed kaw2k closed 7 years ago

kaw2k commented 7 years ago

Fixes issue #92

I dare say we are reaching too much into react internals here. Here is the challenge. We only want to attach refs to valid formable inputs (a React.Component or similar component with a getValue function). The challenge is you normally sniff out that function via the ref and its instance. However when we are cloning these inputs, we don't have an instance yet. To get around this we inspect the prototype of the type of the component.

kaw2k commented 7 years ago

Awesome, thanks @oconn!