gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

Crash with a textbox 'hidden' in a form #284

Closed Sy1v4in closed 8 years ago

Sy1v4in commented 8 years ago

I think you have introduced a regression in your last release removing uvdom. Rendering a hidden textbox returns an object with a tag which has to be compiled with uvdom:

return {
      tag: 'input',
      attrs: {
        type: 'hidden',
        value: locals.value,
        name: locals.name
      }
    }

But it is not compiled anymore. Then react complains: Uncaught Invariant Violation: Textbox.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.

gcanti commented 8 years ago

Thanks @fraisse, working on this...

gcanti commented 8 years ago

Just released a fix in https://github.com/gcanti/tcomb-form-templates-bootstrap/releases/tag/v0.1.1 Reinstalling the package tcomb-form-templates-bootstrap should fix the problem

Sy1v4in commented 8 years ago

Thanks a lot for your reactivity. It works like a charm with this new tcomb-form-templates-bootstrap release ;-)

gcanti commented 8 years ago

Great, thanks for your feedback ;)

Sy1v4in commented 8 years ago

thanks for your work ;-)

Sy1v4in commented 8 years ago

Hi Giulio,

I know this bug is fixed but it is fixed in the new version of the tcomb-form-templates-bootstrap library you forget to update in your present dependencies. Have you planned to update your dependencies?

gcanti commented 8 years ago

Hi @fraisse!

you forget to update in your present dependencies

Not sure I'm follow. In package.json there is "tcomb-form-templates-bootstrap": "^0.1.0". So when you manage a fresh install of tcomb-form npm should dowload the fixed version (0.1.1). Am I missing something?

Sy1v4in commented 8 years ago

For a fresh install you right but it is not true on an existing install with a version 0.1.0 of tcomb-form-templates-bootstrap which is compatible with ^0.1.0.