get-focus / deprecated-focus-graph

Tools based on Redux to easily integrate forms, validate and manipulate data.
http://getfocus.io/focus-documentation/
MIT License
4 stars 3 forks source link

Violent Error using fieldFor from connectToFieldHelpers whitout using connectToForm #55

Closed TomGallon closed 8 years ago

TomGallon commented 8 years ago
export default compose(
    connectToStore(
        selectData('person'), // same thing : (state) => state.dataset.person
    ),
    connectToMetadata(['person']),
    connectToFieldHelpers()
)(PersonHeaderExpanded);

--> i did not have defined a connectToForm. When i use fieldFor, an error appears saying the entityPathArray is not defined.

==> it should have been great to have a error message saying you cannot use a fieldFor without defining a connectToForm. But i not sure it is possible.

pierr commented 8 years ago

I'm not sure what to do about this There is already a check inside the props which is cleaner. You are not forced to use the connectToForm you could provide the props with another way.

But maybe we could add a hint inside the error message. https://github.com/get-focus/focus-graph/blob/master/src/behaviours/field.js#L33

Ephrame commented 8 years ago

Duplicate issue : https://github.com/get-focus/focus-graph/issues/73