All Questions
90 questions
1
vote
1
answer
127
views
TypeError: Cannot read properties of null (reading 'useContext') - Material UI
I'm using MUI(Material UI) in my project.
Component that I'm trying to use is Button.
Check its official component docs here.
Code in which error is occuring :
import * as React from 'react';
import ...
0
votes
1
answer
77
views
Custom typography theme not able to override the default typography in MUI in Next js
I'm using Material-UI (MUI) with a custom theme in my Next.js React project. While colors from the theme are applied correctly, I'm unable to change the default font sizes of H2 and H5 elements. I've ...
0
votes
1
answer
176
views
Custom MUI fields (<TextField />) not recognizing a change in value
I'm trying to create custom form components so I don't need to update every item if I decide on a style change.The ReportSelect version does not update the value upon selection of a menu item, and the ...
1
vote
1
answer
198
views
Display Image in a Material-UI Dialog after clicking an IconButton of the ImageListItemBar
import * as React from 'react';
import Box from '@mui/material/Box';
import ImageList from '@mui/material/ImageList';
import ImageListItem from '@mui/material/ImageListItem';
import ImageListItemBar ...
0
votes
1
answer
15
views
Component OutlinedInput with param "notched" and component InputLabel with param "shrim" does not work correctly in Material UI 5.15.2
I have a very specific problem.. In Material UI 5.15.2 I have my own component built to display InputLabel and OutlinedInput based on certain conditions.. In the example below, I pass a few parameters ...
3
votes
1
answer
239
views
How to correctly wrap Material UI v5 component to force the Grow component work properly?
I'm a React newbie, so I apologise in advance, if there are any stupid mistakes or inaccuracies.
I have a working code of my Blog page:
export default function Blog() {
const [photos, setPhotos] = ...
0
votes
1
answer
317
views
Can I Implement a Regular Drop-Down Menu/ Style Inside a MUI Select Component?
I am currently trying to implement the default drop-down menu appearance in my MUI Select Component.
Desired menu:
My Current Select Component:
I have tried wrapping my select element tag inside my ...
-1
votes
1
answer
417
views
ReactJs: Uncaught SyntaxError: Unexpected token '<' when using map() method in ReactJs that return JSX(MaterialUi-icons) inside the array
i have a file constant.js which contains object name and icon as key. so the key icon contains the icon component from @mui/icons-material and when I try to get the value from the icon but instead I ...
2
votes
1
answer
125
views
How do I inject my own styling into a TabsAPI Tab Panel? Can't stop weird expansion
I'm trying to style the Tabs component provided by MUI and I'm having some trouble figuring out how to accomplish what I would like to. The first problem I'm running into is as follows:
For some ...
1
vote
1
answer
257
views
MaterialUI (MUI) BottomNavigation unwanted transparency
Aspiring hobby developer here. I've used create-react-app to start a new project and import the MUI dependencies.
I added a fixed BottomNavigation like this:
In CodeSandbox the BottomNavigation is ...
2
votes
1
answer
304
views
Storing Selected Value from Button Group in react-hook-form State
I'm attempting to save the selected value from MUI Button Group to the react-hook-form's state, but facing some issues - the value is not being updated correctly.
codesandbox link here
Here's a ...
2
votes
1
answer
547
views
Triangle-like Slider in React js and MUI
I want to create price control using react js and MUI like this below image , but I am facing issue on how to do this.
I have tried finding libraries or any solution at online platforms but haven't ...
0
votes
0
answers
171
views
Material ui Autocomplete text getting disappeared after selecting the option
Front-End [ Face Error]
I am trying to create an Autocomplete using material ui but text in input-text getting disappeared after selecting any option. Also variable 'batsmanOrBowler' gets set as 0 ...
-1
votes
1
answer
38
views
JSX code snippet returns the correct value on one page but returns the wrong value on other pages
{_id === friendId || <IconButton
onClick={() => patchFriend() }
sx={{ backgroundColor: primaryLight, p: "0.6rem" }}
>
{isFriend ? (
<...
-1
votes
1
answer
207
views
why is MUI CORE basic rating code is giving me setValue as undefined?
i tried using MUI CORE for first time and it's giving me arror as i wanted to use active first rating and set value is not defined
i
mport './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
...
1
vote
1
answer
937
views
Difference of using the <NextLink/> and the <Button href="/somePage"/> in the Mui intuitive React UI tools
I am working on a project and wanted to know if there is any significant difference in the use of these two components.
Previously, the return button was done like this:
<NextLink
...
0
votes
1
answer
1k
views
How to solve typescript errors: This condition will always return 'false' since the types have no overlap when I have 3 conditional renderings
I have in my jsx code 3 conditional checks depending on const role which now is hardcoded but later on will have dynamic value. It might have 3 values: "GUEST", "HR", "ADMIN&...
0
votes
1
answer
525
views
How can I change color of MUI TimelineConnector?
I want to change color of all timeline. I tred to set inside JSX this "color="primary" but it works only with
What I'm doing wrong?
<Timeline>
<TimelineItem>
<...
1
vote
0
answers
26
views
Detect screen break point inside the component jsx itself
I have the following component:
<Stack direction="row" spacing={2}>
<Skeleton variant="rounded" animation="wave" sx={{ width: 1 }} />
<...
-2
votes
1
answer
81
views
Render error render in error content area
const Pages = () => {
return (
<>
<Box display="flex">
{window.location.pathname === "/profile" ? undefined : <Sidebar />}
<Box flex={3}>
...
0
votes
1
answer
577
views
React Typescript - Working with multiple checkboxes in a list
I have a usecase where I need to work with multiple checkboxes in a list
Only one check box can be selected at a time
Eg. If I toogle on Checkbox 1 and then click on Checkbox 2 - then I need to toogle ...
9
votes
2
answers
4k
views
Applying InputAdornment to MUI AutoComplete removes the options list
I built an AutoComplete component that looks like this:
<Autocomplete
freeSolo
size="small"
id="filter-locks-autocomplete"
options={json_list ? json_list : []}
...
1
vote
0
answers
113
views
MUI grid squishing together items in chrome despite explicit setting
I am creating a modal with MUI. Currently, everything works fine except for the fact that on chrome, the textfield items inside of a grid container are being squished together. The weird thing is I ...
1
vote
1
answer
1k
views
How to make my content movable according to the Material UI drawer?
I want to move the content from Form.jsx according to the direction in which the drawer will move. When I click on the menu icon, the Drawer will be expanded but the content inside the body cannot be ...
1
vote
1
answer
1k
views
MUI DatePicker hangs on big date changes
MUI DatePicker (either from Labs or X) was working fine. I cannot work out what happened, but it now hangs if I want to change the date by ten years. It seems like the code goes into an infinite loop, ...
0
votes
2
answers
797
views
react mui datables, can't put icons the the left
I'm using react mui datables and i want to add buttons to the toolbar.
I want to put an icon to the right .
My full options :
const options = {
filter: false,
filterType: "checkbox"...
3
votes
1
answer
2k
views
Material UI (dateTime picker) : Invalid Date Format message after submission
I am using Material Ui DateTime picker in a form. After submitting the form, I get the following error:
Invalid Date Format
Image
I am using JSON Server in my react app for saving data.
This is the ...
2
votes
1
answer
1k
views
Add CSS style using className in Material UI component coming from dynamic json object in ReactJS
I have a dynamic json object which contains a button element. I am using createElement and material UI to render the object data.
I wanted to apply customizable CSS using className in the button ...
1
vote
1
answer
658
views
Particles.js does not cover the entire page but instead it is inside the card component
I wanted the Particles.js to be served as background. However, it only shows inside the Card Component. And also how can I make the particles.js not pass through the card. As of now, the card is like ...
1
vote
1
answer
2k
views
material ui datagrid a status menu in table cell
I would like to add a column like Filled Status
But I cannot figure out how to do it from the docs, I feel like I have to use renderCell when setting up the column but I can't see how to accomplish it....
0
votes
2
answers
3k
views
How to change the Icon when clicking on it in react
I`ve got 2 mui icons that I want to switch every click.
I mad a component for them and one of the props(called btnClicked) determines the state,
the component is rendered when clicking but the icon ...
0
votes
1
answer
868
views
When I render a button inside a material-ui table, the button is not clickable
My table looks as such:
<TableContainer component={Paper} style={{height: "40vh", width: "90vh"}}>
<Table size="small" sx={{ minWidth:...
4
votes
1
answer
15k
views
React - adding search to a table, correct way?
I added a search function for my table in React to filter out items fetched from an external webservice. Since I don't want to call the API every time you search for project I figured I'd assign the ...
1
vote
1
answer
282
views
What does angle brackets mean in JS?
I see the following example JSX code:
const AppBar = styled(MuiAppBar, {
shouldForwardProp: (prop) => prop !== 'open',
})<AppBarProps>(({ theme, open }) => ({
zIndex: theme.zIndex....
1
vote
4
answers
1k
views
How to get values of dynamic/multiple fields on formsubmit with React?
I have a form where the user can add Textfields in order to add more items, and I'm struggling to get the items out of the form when they submit it.
The Textfields are created by a component function (...
70
votes
2
answers
48k
views
How can I add unique keys to React/Material UI Autocomplete component?
I'm trying to create a Material UI Autocomplete component that essentially just displays search results to the user. Some of the options' names will be duplicates, but they will all have unique IDs. I ...
1
vote
2
answers
2k
views
Mui icons doesn't work in React (Basic example Card)
C:\Users\Yeap\Documents\react sitio web\my-app\node_modules\react-scripts\scripts\start.js:19
throw err;
^
[Error: ENOENT: no such file or directory, stat 'C:\Users\All Users'] {
errno: -4058,
...
0
votes
1
answer
484
views
Can't able to clear the input value to empty string
I have made a table with a search bar functionality, it filter the data when press the search button and reset the filter function and show unfilter data when click the clear button but it's not ...
1
vote
0
answers
680
views
Error Downloading an excel file from a React App
I would like to download an excel file from my react app.
I have a download button with the prop onClick={handleExcel}. Within my handleExcel constant I have the following code:
const handleExcel = () ...
1
vote
1
answer
51
views
Routing for persistant drawer in material UI
I want to use this as a navigation for my page ,
but i cant find out how to Link in the index properly,
I already tried to put l the items apart but that didnt work
whit ,,
and
<List&...
0
votes
1
answer
787
views
Proper syntax for mapping font style from object map to map()
React, JS, and Material UI
Ok, probably a noob question, but what the hell am I doing wrong with my syntax in my style property in my map function?
Fonts.jsx
export const fonts = [
{
fontName: '...
1
vote
2
answers
51
views
How do I render component based on state
I've got this filter Icon from MaterialUI and I need it to be filled black (for now it can change position) when a checkmark is checked. When a box is checked setFilters is filled. So if a check is ...
0
votes
0
answers
830
views
ReactJS: How to expand and show API calling in Tree View Node Material UI?
I have tree View Material UI in React. Can it be possible that the API called after the node is clicked and append the child to the node clicked so that it won't update to the other children in node ...
1
vote
1
answer
62
views
react matrerial ui Error: Objects are not valid as a React child If you meant to render a collection of children, use an array instead
I am facing the error with the following code and there seems to be no fixes that is solving my issue.
componentDidMount() {
axios.get('http://localhost:8080/home')
.then((response) =>...
1
vote
2
answers
539
views
Make div on left side fill screen width based on screen width and with an offset to the center
I have a parent div with two children inside and I want the first child to go to the left side and the second child should go to the right side. My main problem is they can't start from the exact ...
1
vote
0
answers
532
views
MUI MakeStyles not working as expected when passing props
I've been working on a range date picker made with React and Material-ui. I have an atom component (button) which gets some styles after dates some date values change.
Is not the best code but by now ...
2
votes
0
answers
386
views
react-admin: <Show> component elements not rendering when wrapped inside divs
I'm currently working on an admin portal using react-admin, and I've been able to seamlessly style it using MaterialUI, specifically its makeStyles hook. The way I've done it is I'd import my ...
0
votes
1
answer
465
views
React Material Design Icon hover not working correctly
I'm using mdi-react icons and the hovering doesnt work well. Sometimes it works, sometimes it doesnt.
import MagnifyPlusOutline from "mdi-react/MagnifyPlusOutlineIcon";
import ...
1
vote
2
answers
1k
views
Finding an Uncaught TypeError: Cannot read property 'length' of undefined
I want to put a function that checks whether the cart is empty or filled and display output based on this logic.
if cart.line_items.length is not true then it should run the EmptyCart function.
note ...
0
votes
1
answer
504
views
how to render component from .map() in react
So im trying to not duplicate code and probably over complicating this but im very curious if there is a way for a system like this to work
<Drawer anchor="right" open={...