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

[Link] Receipt for global theme link fails on Typings #32306

Closed
2 tasks done
aaarichter opened this issue Apr 14, 2022 · 1 comment · Fixed by #32308
Closed
2 tasks done

[Link] Receipt for global theme link fails on Typings #32306

aaarichter opened this issue Apr 14, 2022 · 1 comment · Fixed by #32308
Labels
component: link This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation

Comments

@aaarichter
Copy link
Contributor

aaarichter commented Apr 14, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Implementing example of https://mui.com/material-ui/guides/routing/#global-theme-link fails typing

MUI: 5.6.1
Typescript: 4.6.3
react-router: 6.2.2
react-router-dom: 6.2.2

Screenshot 2022-04-14 at 20 37 20

Expected behavior 🤔

a correct receipt (including imports and typings) or an adapter that handles this automatically

Steps to reproduce 🕹

Steps:

  1. create a theme with the example from https://mui.com/material-ui/guides/routing/#global-theme-link
  2. add router import beforehand
import {
  Link as RouterLink,
  LinkProps as RouterLinkProps,
} from 'react-router-dom';
  1. inspect / run typescript

Context 🔦

I'm trying to to use react-router with MUI & I'm using Typescript 🙈

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: macOS 12.3.1
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 100.0.4896.88
    Edge: Not Found
    Firefox: 98.0.2
    Safari: 15.4
  npmPackages:
    @emotion/react: 11.8.2 => 11.8.2 
    @emotion/styled: 11.8.1 => 11.8.1 
    @mui/base:  5.0.0-alpha.76 
    @mui/icons-material: 5.6.1 => 5.6.1 
    @mui/material: 5.6.1 => 5.6.1 
    @mui/private-theming:  5.6.1 
    @mui/styled-engine:  5.6.1 
    @mui/system: 5.6.1 => 5.6.1 
    @mui/types:  7.1.3 
    @mui/utils:  5.6.1 
    @types/react: 17.0.16 => 17.0.16 
    react: 17.0.2 => 17.0.2 
    react-dom: 17.0.2 => 17.0.2 
    styled-components: 5.3.5 => 5.3.5 
    typescript: 4.6.3 => 4.6.3 

@aaarichter aaarichter added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 14, 2022
@aaarichter
Copy link
Contributor Author

in the codesandbox example https://codesandbox.io/s/syhtv1?file=/demo.tsx:1064-1077 is shows that you need set as LinkProps in the theme

aaarichter pushed a commit to aaarichter/material-ui that referenced this issue Apr 14, 2022
@danilo-leal danilo-leal added the component: link This is the name of the generic UI component, not the React module! label Apr 14, 2022
aaarichter pushed a commit to aaarichter/material-ui that referenced this issue May 11, 2022
@michaldudak michaldudak added docs Improvements or additions to the documentation and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 3, 2022
@michaldudak michaldudak removed their assignment Jun 3, 2022
aaarichter pushed a commit to aaarichter/material-ui that referenced this issue Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: link This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants