jquense / react-formal

Sophisticated HTML form management for React
http://jquense.github.io/react-formal
MIT License
527 stars 52 forks source link

Uncaught TypeError: Cannot read property 'match' of undefined #125

Open alburritos opened 7 years ago

alburritos commented 7 years ago

I'm trying to use Form.button so that I can validate only one group of fields within a Form component.

                      <Form.Button
                        group="data"
                        component={ Button }
                        key="save"
                        type="button"
                        className="save"
                        onClick={ () => console.log('lol') }
                      >
                        Save
                      </Form.Button>,

All the Form.Field components that are relevant have the prop group="data" as well.

But then I click on the button, I get an Uncaught TypeErorr, which in my bundle leads me to here:

      split: function(path){
        return path.match(SPLIT_REGEX)
      }

Any idea how to fix this? I can't find any other way to selectively validate a form.

alburritos commented 7 years ago

@jquense Could you please advise on how I would validate a particular group of input fields within a form?

jquense commented 7 years ago

hey there, sorry. I believe I've fixed this bug in the most recent release can you confirm whether that's true or not?

alburritos commented 7 years ago

Is there a changelog? I don't see one. Just want to make sure there's no breaking changes from 0.23.0

jquense commented 7 years ago

No functional changelog.com at the moment but changes should be safe (I think)

alburritos commented 7 years ago

@jquense

Thanks for the follow up. I've upgraded to 0.25.4, and when I have the type of Form.Button

                      <Form.Button
                        group="data"
                        key="save"
                        type="button"
                        component={ Button }
                        className="button"
                        onClick={ () => console.log('abc') }>

set to "button", I still get

Uncaught TypeError: Cannot read property 'match' of undefined

All the Form.Field entries that I need to to be validated that are associated with this group are have the prop group="data", and so does Form.Button.

jquense commented 7 years ago

Thanks, I'll take a look. Do you think you could put together a minimal reproduction that demonstrates the issue? It'll be easier to track down the bug