mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
94.11k stars 32.34k forks source link

[docs] Snackbar, control Slide direction. Type of property `children` are incompatible #36806

Open kasir-barati opened 1 year ago

kasir-barati commented 1 year ago

Duplicates

Related page

https://mui.com/material-ui/react-snackbar/#control-slide-direction

Kind of issue

Broken demonstration

Issue description

I was looking for "Control Slide direction" and it appears that Types of property 'children' are incompatible. Here is the my working env conf:

And here is the complete error:

Type '{ direction: "right"; appear?: boolean; enter?: boolean; exit?: boolean; timeout?: number | { appear?: number; enter?: number; exit?: number; } | { appear?: number; enter?: number; exit?: number; }; in?: boolean; ... 270 more ...; onTransitionEndCapture?: TransitionEventHandler<...>; }' is not assignable to type 'SlideProps'.
  Types of property 'children' are incompatible.
    Type 'ReactNode' is not assignable to type 'ReactElement<any, any>'.
      Type 'string' is not assignable to type 'ReactElement<any, any>'.ts(2322)

Context 🔦

I was using snackbars and transitions without problem in the browser (pnpm dev), but VSCode shows me this error.

image

siriwatknp commented 1 year ago

Would be great if you can share a CodeSandbox so that we are on the same page.

kasir-barati commented 1 year ago

Would be great if you can share a CodeSandbox so that we are on the same page.

TBH I do have a repo and I am not sure if it can help you: https://github.com/kasir-barati/open-ai-summaries