mui / mui/material-ui

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

Open
#36,806 2 comments 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Apr 10, 2023.

scope: toast scope: transitions typescript
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
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:

  • uname -a: Linux kasir-lifebooke736 6.1.19-1-MANJARO #1 SMP PREEMPT_DYNAMIC Mon Mar 13 12:59:35 UTC 2023 x86_64 GNU/Linux
  • node -v: v19.7.0
  • npm -v: 9.5.0
  • pnpm -v: 7.29.0
  • "react": "^18.2.0"
  • "@emotion/react": "^11.10.6",
  • "@emotion/styled": "^11.10.6",
  • "@mui/icons-material": "^5.11.16",
  • "@mui/material": "^5.11.16",

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.