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

[docs] Remove "props not recognized by the pickers are not passed down to material-ui TextField" #1837

Closed
stunaz opened this issue May 29, 2020 · 3 comments · Fixed by #1838
Labels
docs good first issue Great for newcomers

Comments

@stunaz
Copy link
Contributor

stunaz commented May 29, 2020

Environment

Tech Version
@material-ui/pickers 4.0.0-alpha.7
material-ui latest
TypeScript latest
React latest
Peer library dayjs

Steps to reproduce

I thought I could do the following :

            <DatePicker
                label="Basic example"
                variant="outlined"
                value={selectedDate}
                onChange={(date: any) => handleDateChange(date)}
                renderInput={(muiProps) => <TextField {...muiProps} />}
            />

muiProps does not have the variant prop, although the docs says:

Any prop not recognized by the pickers and their sub-components are passed down to material-ui TextField component.

I know I could/(probably should) pass the variant prop on the renderInput, but the docs says I could use it on DatePicker and it will passed down to TextField as it is not a DatePicker prop.

Expected behavior

TextField props passed to DatePicker should passed down to the render props.

Actual behavior

  1. typescript complains that variant does not match type
  2. variant is not passed down to the render props.

and other questons
why is not renderInput={(muiProps) => <TextField {...muiProps} />} the default behaviour ?

@dmtrKovalenko dmtrKovalenko changed the title Props not recognized by the pickers are not passed down to material-ui TextField [docs] Remkve "props not recognized by the pickers are not passed down to material-ui TextField" May 29, 2020
@dmtrKovalenko dmtrKovalenko changed the title [docs] Remkve "props not recognized by the pickers are not passed down to material-ui TextField" [docs] Remove "props not recognized by the pickers are not passed down to material-ui TextField" May 29, 2020
@dmtrKovalenko
Copy link
Member

Yes, thanks we need to remove it.

@oliviertassinari oliviertassinari added the duplicate This issue or pull request already exists label May 29, 2020
@oliviertassinari
Copy link
Member

Duplicate of #1792

@oliviertassinari oliviertassinari marked this as a duplicate of #1792 May 29, 2020
@oliviertassinari oliviertassinari added docs good first issue Great for newcomers and removed duplicate This issue or pull request already exists labels May 29, 2020
@oliviertassinari
Copy link
Member

Actually, I think that we can handle the documentation issue here. @stunaz What do you think of this diff?

diff --git a/docs/pages/api/props.tsx b/docs/pages/api/props.tsx
index c0a3b966..34e865f0 100644
--- a/docs/pages/api/props.tsx
+++ b/docs/pages/api/props.tsx
@@ -44,20 +44,6 @@ const Docs: React.FC<WithRouterProps> = ({ router }) => {
       <h4> Import </h4>
       <Code language="jsx">{`import { ${componentName} } from '@material-ui/pickers'`}</Code>

-      <h4> Inheritance </h4>
-      <Typography gutterBottom>
-        Any prop not recognized by the pickers and their sub-components are passed down to
-        material-ui{' '}
-        <a
-          target="_blank"
-          rel="noopener noreferer"
-          href="https://material-ui.com/api/text-field/#props"
-        >
-          TextField
-        </a>{' '}
-        component.
-      </Typography>
-
       <Typography gutterBottom>
         <code>DateIOType</code> — date object type of your linked date-io adapter (Moment, DayJS,
         etc.)

Do you want to work on it? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs good first issue Great for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants