Giter VIP home page Giter VIP logo

Comments (10)

DiegoAndai avatar DiegoAndai commented on April 28, 2024 2

I created a typescript playground with all the problems I could find, including this one:

  • If only the Value type argument is provided, inference on Variant doesn't work due to microsoft/TypeScript#10571
  • If the Variant type arguments are provided with value "standard" or "filled", but the variant prop is not provided, then the "outlined" variant will be rendered. TS should catch this.
  • When trying to wrap the Select, variant is incorrectly required and inference stops working (this issue)

from material-ui.

DiegoAndai avatar DiegoAndai commented on April 28, 2024 1

Hey @maapteh, thanks for the report.

Also reported here: #39137 (comment)

I'll look into it this week

from material-ui.

maapteh avatar maapteh commented on April 28, 2024

Thank you, i looked but search didnt find anything. I will see if making them optional again will fix my issue.

FYI, this is breaking type change for people using SelectProps 
directly because the variant prop is required now when it wasn't 
before. I guess BaseSelectProps is a suitable replacement 
for most use cases?

This was helpful but not fixing the root cause:)

from material-ui.

maapteh avatar maapteh commented on April 28, 2024

I created a fix in the PR attached to this issue report!

from material-ui.

maapteh avatar maapteh commented on April 28, 2024

Please look at it @DiegoAndai when you find the time :)

from material-ui.

DiegoAndai avatar DiegoAndai commented on April 28, 2024

Hey @maapteh, may I ask you to provide a minimal reproduction? This would help a lot in debugging the issue. A live example would be perfect. This StackBlitz sandbox template may be a good starting point.

from material-ui.

maapteh avatar maapteh commented on April 28, 2024

I solved it in #41359 right?

from material-ui.

DiegoAndai avatar DiegoAndai commented on April 28, 2024

I'm not sure, I left a comment there

from material-ui.

maapteh avatar maapteh commented on April 28, 2024

Ah now i see, but its a union type so i dont see how that would work...
I created the sample at https://stackblitz.com/edit/stackblitz-starters-gfn7kp?file=src%2FApp.tsx

Screenshot 2024-03-05 at 23 48 10

from material-ui.

DiegoAndai avatar DiegoAndai commented on April 28, 2024

I'll add the ready to take label to see if we get any contributors with ideas. This is the isolated repro: typescript playground. If you have an idea on how to support wrapping the Select component and avoid the errors in the playground, let's discuss here.

from material-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.