material-ui

Cannot import @material-ui/core/styles/MuiThemeProvider

自作多情 提交于 2020-05-12 02:43:09
问题 I am working on a React project, using Material UI React components. I want to import MuiThemeProvider in src/index.js like so import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider"; . But I get Module not found: Can't resolve '@material-ui/core/styles/MuiThemeProvider' Checking the /node_modules/@material-ui/styles there is no MuiThemeProvider . I dont understand that. Installing the project freshly on another computer, the /node_modules/@material-ui/styles contains a

Cannot import @material-ui/core/styles/MuiThemeProvider

北战南征 提交于 2020-05-12 02:42:45
问题 I am working on a React project, using Material UI React components. I want to import MuiThemeProvider in src/index.js like so import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider"; . But I get Module not found: Can't resolve '@material-ui/core/styles/MuiThemeProvider' Checking the /node_modules/@material-ui/styles there is no MuiThemeProvider . I dont understand that. Installing the project freshly on another computer, the /node_modules/@material-ui/styles contains a

How I implement new material gmail toolbar without nested scrollview?

可紊 提交于 2020-05-11 03:16:21
问题 I want to implement new gmail like toolbar without nested scroll view, which is scroll able, but when scroll down background should be visible. It will look like this: 回答1: It's not a nested scrollview, Its recyclerView. If you want such a search bar, you can make it using CardView and Edittext or use Material searchbar library. You can place it locked at that position by using frameLayout or CoordinatorLayout. Here is a sample Screen I made!. <?xml version="1.0" encoding="utf-8"?> <android

Setting text color, outline, and padding on Material-ui Autocomplete component

混江龙づ霸主 提交于 2020-04-28 09:36:44
问题 We'd like to change the text color, outline, and padding on a Material-ui Autocomplete component. The code looks like this: <FormControlLabel label="Please enter desired service:" labelPlacement="start" control={ <Autocomplete id="services" options={props.serviceTypes} getOptionLabel={option => option.name} className={classes.inputRoot} style={{ width: 400, paddingLeft: 20 }} renderInput={params => ( <TextField {...params} label="" className={classes.inputRoot} variant="outlined" fullWidth />

Setting text color, outline, and padding on Material-ui Autocomplete component

笑着哭i 提交于 2020-04-28 09:34:54
问题 We'd like to change the text color, outline, and padding on a Material-ui Autocomplete component. The code looks like this: <FormControlLabel label="Please enter desired service:" labelPlacement="start" control={ <Autocomplete id="services" options={props.serviceTypes} getOptionLabel={option => option.name} className={classes.inputRoot} style={{ width: 400, paddingLeft: 20 }} renderInput={params => ( <TextField {...params} label="" className={classes.inputRoot} variant="outlined" fullWidth />

Setting text color, outline, and padding on Material-ui Autocomplete component

僤鯓⒐⒋嵵緔 提交于 2020-04-28 09:33:49
问题 We'd like to change the text color, outline, and padding on a Material-ui Autocomplete component. The code looks like this: <FormControlLabel label="Please enter desired service:" labelPlacement="start" control={ <Autocomplete id="services" options={props.serviceTypes} getOptionLabel={option => option.name} className={classes.inputRoot} style={{ width: 400, paddingLeft: 20 }} renderInput={params => ( <TextField {...params} label="" className={classes.inputRoot} variant="outlined" fullWidth />

Material-ui v4 Cannot read property 'root' of undefined for every component

我的未来我决定 提交于 2020-04-18 07:10:07
问题 I've migrated from Material-UI v3 to v4.now this error shows up for every component I import: app.js:3581 Uncaught TypeError: Cannot read property 'root' of undefined at Button (app.js:3581) at renderWithHooks (app.js:126202) at updateForwardRef (app.js:127721) at beginWork (app.js:128925) at performUnitOfWork (app.js:132576) at workLoop (app.js:132616) app.js:130381 The above error occurred in the component: in WithStyles(ForwardRef(Button)) (created by Rtl) in StylesProvider (created by Rtl

How to create Material-UI nested style object from array using map in React

牧云@^-^@ 提交于 2020-04-18 06:31:30
问题 I have some prop data that gets passed in like this columns={ [ { name: "Fund Name", width: "40%" }, { name: "Review Date", width: "20%" }, { name: "Company Debt", width: "20%" }, { name: "Alerts", width: "10%" } ]; } I need it to look like this... const localTheme = { overrides: { MUIDataTableHeadCell: { root: { "&:nth-child(1)": { width: "40%" }, "&:nth-child(2)": { width: "20%" }, "&:nth-child(3)": { width: "20%" }, "&:nth-child(4)": { width: "10%" }, "&:nth-child(5)": { width: "10%" } } }

Material-UI formControlLabel whole label is clickable only text should be

≯℡__Kan透↙ 提交于 2020-04-18 06:12:13
问题 I am new to the material UI . here I have the following form <FormControl variant="outlined" className={css.formControl} margin="dense" key={"abc_" + index} > <FormControlLabel control={ <Checkbox onClick={handleClick(data)} checked={_.some(selected, { Id: selected.Id })} value={selected.Id} color="default" /> } label={data?.Name ?? "NO_LABEL"} /> </FormControl> Now, this whole label gets clickable as the area is a bit long, so, what I am trying is the only the checkbox and the text should be

How to manage multi Text Field validation in material-ui react?

て烟熏妆下的殇ゞ 提交于 2020-04-18 05:31:48
问题 I am creating a form in Materia-UI and React.js, and I am making validation of two TextField. I want to validate both TextFields with same error and textHelper props. Below I have show a piece of code of my work. If somebody have an idea please share with me, it will be helpful. const AddPost = ({error, helperText, handleInputChange, handleSubmit}) => { <div> <form onSubmit={handleSubmit}> <TextField value={titleValue} onChange={handleInputChange} helperText={helperText} error={error} name={