Field prop `data` moved from `...rest` props into `meta` prop
See original GitHub issueAre you submitting a bug report or a feature request?
Bug report
What is the current behavior?
The package react-native-material-dropdown
has a data
prop to pass the list of items for dropdown.
https://github.com/n4kz/react-native-material-dropdown
Previously to #711 PR I used the final-form wrapper as
<Dropdown
{...input}
onChangeText={input.onChange}
value={`${input.value}`}
label={label}
error={getErrorMessage(meta)}
{...rest}
/>
For now data
prop moved from ...rest
to meta
prop. So I’ve got an unexpected bug. To fix it I need to pass the data
prop manually
<Dropdown
{...input}
data={meta.data} // I need to pass this prop manually
onChangeText={input.onChange}
value={`${input.value}`}
label={label}
error={getErrorMessage(meta)}
{...rest}
/>
What is the expected behavior?
The expected is that the data
prop remains in ...rest
props.
Sandbox Link
https://codesandbox.io/s/hardcore-bird-hly9t
What’s your environment?
“final-form”: “^4.18.7”, “react-final-form”: “^6.3.5”,
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to pass all other props to react class? - Stack Overflow
how would I pass down any other props that I originally don't expect, but say someone else using my component would want to...
Read more >Transferring Props | React
Rest properties allow you to extract the remaining properties from an object into a new object. It excludes every other property listed in...
Read more >Lifting State Up - React
Let's see how this works step by step. First, we will replace this.state.temperature with this.props.temperature in the TemperatureInput component.
Read more >React-admin - Upgrading to v4 - Marmelab
The <Admin initialState> prop used to be used to initialize the store. As there is no Redux store anymore, you cannot set the...
Read more >Unit Testing in React: Full Guide on Jest and Enzyme Testing
Testing props: As a rule, I divide the testing of the props into two tests: – Firstly, check the render of default prop...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The commit at f3c1aea has the backwards-incompatible effect of preventing a
<Field>
from using a prop called data. We have that does this, and which inexplicably stopped working due to the react-final-form change. (One of our devs spent the whole morning tracking down this action-at-a-distance bug.)Can this change please be unwound until the next major release, since it’s a breaking change?
In my eyes the change made is still a bugfix as the intention of the
<Field />
props were that they provide the parameters forFieldConfig + x
.data
is part of theFieldConfig
. It was not there and it should be => bugfix. Surplus props are passed down to the rendered component.That being said, exactly for the reason of namespace collisions
useField
or<Field>{(props) => ...}</Field>
exist.