question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 lowercase marginhorizontal 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:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
RWOverdijkcommented, Mar 24, 2020

@artyorsh I get that, but it would be an excellent addition! I’ll close this for now.

1reaction
RWOverdijkcommented, Mar 23, 2020

All right. I could do that… But I think I’ll instead look into fixing it for this library and make a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React: Invalid value for prop `savehere` on <div> tag. Either ...
The problem here is that a non-stardard input prop savehere of your <AddGuest/> component which is being directly spread into the <Modal/> ...
Read more >
Overview of Flex UI programmability options - Twilio
Get an overview of the ways you can customize Flex including Flex Manager, overriding language strings, theming Flex UI, UI components, and more....
Read more >
The Details disclosure element - HTML - MDN Web Docs
This Boolean attribute indicates whether the details — that is, the contents of the <details> element — are currently visible.
Read more >
Building a dialog component - web.dev
A foundational overview of how to build color-adaptive, responsive, and accessible mini and mega modals with the element.
Read more >
How To Share State Across React Components with Context
The image and name will be props. The code uses the favorite variable and ternary operators to conditionally determine if the favorite icon...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found