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

SwipeableSidebar sidebarId props Warning React Typescript #976

Open
arelaxend opened this issue Nov 5, 2020 · 2 comments
Open

SwipeableSidebar sidebarId props Warning React Typescript #976

arelaxend opened this issue Nov 5, 2020 · 2 comments
Labels
good first issue Good for newcomers

Comments

@arelaxend
Copy link

Dear Mui-treasury contributors,

What is the problem ?
There is a warning while using SwipeableSidebar with Tyepscript:

Warning: React does not recognize the `sidebarId` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `sidebarid` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in div (created by ForwardRef(Drawer))
    in ForwardRef(Drawer) (created by WithStyles(ForwardRef(Drawer)))
    in WithStyles(ForwardRef(Drawer)) (created by ForwardRef(SwipeableDrawer))
    in ForwardRef(SwipeableDrawer) (created by ProxyComponent)
    in ProxyComponent (created by ForwardRef(StyledComponent))
    in ForwardRef(StyledComponent) (created by PersistentSwipeableSidebar)
    in PersistentSwipeableSidebar (created by Context.Consumer)
    in SidebarProvider (created by SwipeableSidebar)

How to reproduce ?

  1. CRA with typescript
  2. Use swipeableSidebar for e.g.
        <SwipeableSidebar
          PaperProps={{ className: classes.sidebar }}
          sidebarId="desktopsidebar"
        >
          <Sidebar navConfig={navConfig} />
        </SwipeableSidebar>
  1. Warning shows up.

Best.

@siriwatknp
Copy link
Owner

Hi, this should be a quick fix to not pass sidebarId to DOM.

@siriwatknp siriwatknp added the good first issue Good for newcomers label Apr 15, 2021
@jordiyapz
Copy link

This also happens when I use Vite with typescript.

@siriwatknp I don't get it. Please show us what changes are necessary to fix that. Thanks.

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

No branches or pull requests

3 participants