-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add name proptype, close #2110 #2112
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
Conversation
ljharb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding the propType wouldn’t do anything - the component would have to use it, and we’d need tests and a storybook story.
|
|
|
In order to remove the warning, we'd have to actually use the prop inside |
|
Oh correct, sorry, wrong component, fixed |
|
and which component is using the |
|
yes SingleDatePicker, the one component I use in https://codesandbox.io/s/react-datepickers-o9fbh?file=/src/Datepicker.js you can see the warning: And you can also see that date attribute is passed to the input, so I guess that prop is spread to other components <input class="css-1fqugce" aria-label="YYYY-MM-DD" type="text" id="date" name="date" placeholder="YYYY-MM-DD" autocomplete="off" required="" aria-describedby="DateInput__screen-reader-message-date" value="2021-05-05"> |
|
It's not, in fact - the name is always the same as the ID: https://github.com/airbnb/react-dates/blob/master/src/components/DateInput.jsx#L229-L230 |
|
@ljharb Oh thanks, good to know. I'm not really a fan of those 'opinionated' choices, but I'll do with it. It'd be better I think to allow to pass independently name and id Let's deal with this choice for now, thanks |
No description provided.