Web: dispatch and icon props set as attributes
See original GitHub issue🐛 Bug Report
I’m getting the following in the browser (expo, react native web):
Warning: React does not recognize the
marginHorizontal
prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercasemarginhorizontal
instead. If you accidentally passed it from a parent component, remove it from the DOM element.
All I’m doing is:
<Button
style={style}
icon={iconStyle => <Icon name='plus' {...iconStyle} />}
size='small'
status='primary'
/>
as stated in the docs. However, the props get passed through all the way to the rendered component and that’s not allowed for attributes.
I’m having the same issue with dispatch:
Warning: Invalid value for prop
dispatch
on <div> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://fb.me/react-attribute-behavior
Although I’m not sure where that’s coming from to be honest.
To Reproduce
- New expo project
- add ui kitten
- open in the browser
- Implement some components with UI kitten
- Check console
Expected behavior
No warnings
Link to runnable example or repository (highly encouraged)
I tried, but the sandbox seems broken (https://codesandbox.io/s/ui-kitten-welcome-x8q8z)
(0 , _reactNative.requireNativeComponent) is not a function
UI Kitten and Eva version
Package | Version |
---|---|
@eva-design/eva | Master |
@ui-kitten/components | Master |
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top GitHub Comments
@artyorsh I get that, but it would be an excellent addition! I’ll close this for now.
All right. I could do that… But I think I’ll instead look into fixing it for this library and make a PR.