gpietro / react-numpad

A numpad for number, date and time, built with and for React.
MIT License
138 stars 38 forks source link

Props Warnings in KeyPad #115

Closed miltonbo closed 5 years ago

miltonbo commented 5 years ago

I followed the documentation, but some validations are showing in the console.

Warning 1:

Warning: Failed prop type: The prop `confirm` is marked as required in `KeyPad`, but its value is `undefined`.
    in KeyPad (created by NumberInput)
    in NumberInput (created by ThirdStep)
    in div (created by ThirdStep)

Warning 2:

Warning: Failed prop type: The prop `update` is marked as required in `KeyPad`, but its value is `undefined`.
    in KeyPad (created by NumberInput)
    in NumberInput (created by ThirdStep)
    in div (created by ThirdStep)

Warning 3:

Warning: Failed prop type: The prop `position` is marked as required in `KeyPad`, but its value is `undefined`.
    in KeyPad (created by NumberInput)
    in NumberInput (created by ThirdStep)
gpietro commented 5 years ago

Yes, I'm aware of the warnings. This is casued by React.cloneElement that doesn't consider Required props. I'm considering to fix this by setting a default props.

miltonbo commented 5 years ago

@gpietro my friend, I have the same warnings, do you have some solution?