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

[system] Box props types any #21825

Closed
jonlepage opened this issue Jul 18, 2020 · 8 comments
Closed

[system] Box props types any #21825

jonlepage opened this issue Jul 18, 2020 · 8 comments
Labels
component: Box The React component. duplicate This issue or pull request already exists package: system Specific to @mui/system

Comments

@jonlepage
Copy link

jonlepage commented Jul 18, 2020

Hi guys , do i have a bug somewhere in my config or you dont provide a flexbox types for intellisence?
I cant get suggestions from flex api when i use your Box components.
image
Any way to get flexbox types suggestions from your Box api ?
i try npm install @types/react-flex -D -S but not work !

@jonlepage jonlepage added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 18, 2020
@oliviertassinari oliviertassinari added component: Box The React component. typescript and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 18, 2020
@oliviertassinari
Copy link
Member

@djmisterjon Thanks for raising the issue, I can reproduce it on https://codesandbox.io/s/material-demo-cilh8?file=/demo.tsx.

@oliviertassinari oliviertassinari changed the title flexbox api @types Box props types any Jul 18, 2020
@oliviertassinari oliviertassinari changed the title Box props types any [Box] props types any Jul 18, 2020
@eps1lon
Copy link
Member

eps1lon commented Jul 19, 2020

What type should it have in your opinion and why?

@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 19, 2020

Would it make sense to have?

import * as CSS from 'csstype';

CSS.Properties['justifyContent'];

However, we would also need to account for the breakpoint API.

@jonlepage
Copy link
Author

jonlepage commented Jul 19, 2020

sorry guys, I can't really help you on this level, I don't have a lot of frontend experience and especially CSS.
It why i ask you if is normal about cant get suggestions for some props in your API.
The only thing i can tell you, is how i work with your API.
I work on multi screen with a SDK framework for desktop and use the developer tool to work with live CSS suggestions, than when i get the result i need, i copy paste properties in my CSS files (.less) . (no dynamic)

I dont like have to managing CSS inside .JS and .JSX , i think it the way that's your API suggest to work.
For dynamic CSS, am using style={{}} and props.
But for box, i always need opend SDK to be sure to no made mistake on flexbox properties.
It slow down little bit the workflow.

image

It's not very serious urgent, but just if you think you have a simple solution, i will take.
Thank you so much for your great work, I love react with MUI and ANTD ! It make so easy to work with the frontend world.

@jonlepage
Copy link
Author

jonlepage commented Jul 20, 2020

For sure i can maybe , use only direct styles !? its seem have types suggestions!
image
but we have to use important! sometime when it is require, and also it remove the fun of props workflow.

ps: boilerplate using in my workflow is share there .
https://github.com/djmisterjon/nw-Parcel-hmr-boilerplate

@jonlepage

This comment has been minimized.

@jonlepage
Copy link
Author

jonlepage commented Sep 23, 2020

ok so i success for my own modules

image
by adding import * as CSS from 'csstype'; and some jsdoc
@param {CSS.Property.FlexDirection} [props.flexDirection] - descriptions
image

So it would be a good idea to include it natively in your library for <Box>

@oliviertassinari oliviertassinari added the package: system Specific to @mui/system label Oct 20, 2020
@oliviertassinari oliviertassinari changed the title [Box] props types any [system] Box props types any Oct 20, 2020
@oliviertassinari
Copy link
Member

Duplicate of #15451

@oliviertassinari oliviertassinari marked this as a duplicate of #15451 Oct 20, 2020
@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed typescript labels Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Box The React component. duplicate This issue or pull request already exists package: system Specific to @mui/system
Projects
None yet
Development

No branches or pull requests

3 participants