Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown prop options on <div> tag raised on Select component #172

Closed
bcardiff opened this issue Mar 23, 2018 · 5 comments
Closed

Unknown prop options on <div> tag raised on Select component #172

bcardiff opened this issue Mar 23, 2018 · 5 comments

Comments

@bcardiff
Copy link

bcardiff commented Mar 23, 2018

What RMWC Version are you using?

1.4.0

What browser(s) and React Version is this bug affecting?

Google Chrome Version 65.0.3325.162 (Official Build) (64-bit)
React 15.5.4
No build system

What are the steps to reproduce the bug?

Follow sample of Select https://jamesmfriedman.github.io/rmwc/select-menus

What is the expected behavior?

No console errors

What is the actual behavior?

Warning: Unknown prop `options` on <div> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
    in div (created by ListItemRoot)
    in ListItemRoot (created by withRipple(ListItemRoot))
    in Ripple (created by withRipple(ListItemRoot))
    in withRipple(ListItemRoot) (created by ListItem)
    in ListItem (created by Select)
    in div (created by List)
    in List (created by MenuItems)
    in MenuItems (created by Select)
    in div (created by MenuRoot)
    in MenuRoot (created by SelectMenu)
    in SelectMenu (created by Select)
    in div (created by SelectRoot)
    in SelectRoot (created by Select)
    in Select (created by withMDC(Select))
    in withMDC(Select) (created by App)
    in div (created by App)
    in App

Please describe what the component/code is actually doing that's different from what it should be
doing.

List a plain set of options with the Select.

Any other information you believe would be useful?

I've checked that happens on React 15.6.2 also (latest 15.* release), but the warning error does not appear in React 16.2.0 because of custom attributes support probably.

Fin a codesanbox to reproduce the issue.

https://codesandbox.io/s/mmlz1lpryx

@jamesmfriedman
Copy link
Collaborator

Thank you for reporting, and thank you very much for the repro! Definitely helped in troubleshooting. I installed your exact version to troubleshoot.

I fixed the options issue and discovered a misuse of tab-index as well. Will go out in tomorrows patch.

@jamesmfriedman
Copy link
Collaborator

Fixed in 1.4.1

@bcardiff
Copy link
Author

Thanks @jamesmfriedman !

Maybe I should create another issue, but before doing it I would rather ask: Did you notice the "Accessing PropTypes via the main React package" message in the same codesandbox? In react 15.5.4 is an error, in 15.6.2 is a warning. Through the source code I couldn't find the offending line. Maybe there is something that iterate all props of a package or something and that triggers the message.

@jamesmfriedman
Copy link
Collaborator

RMWC doesn't access any proptypes via the main package, it only imports them from the PropTypes repo and only uses them for the contextTypes api.

Just curious, is there a reason you are stuck on such an old version of React? They hardly ever have breaking changes between versions and upgrading is generally straight forward. There are some incompatibilities with older versions that at some point won't be able to be mitigated with RMWC.

With that said, I'm definitely interested in supporting 15.x as long as possible.

@bcardiff
Copy link
Author

@jamesmfriedman In this very first project I am trying to use rmwc, yes I am stuck with react 15.x (it's a site using reagent which hasn't migrate to 16.x still).

I think I found the trigger of the warning: from facebook/flow#4673 it seems that require * from 'react' as used here or here or other places, will trigger the warning.

It's not blocking, but been unable to have a warning/error-free console is problematic for the sanity of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants