score:1
Accepted answer
put condition on icon props on steplabel.
icon={error ? <error /> : label.step}
like as mention below 👇
stepper alternativelabel activestep={this.determineformstep()} connector={<stepconnector />} classname={classes.stepper}>
{formlabels.map((label, index) => {
return (
<step key={label}>
<steplabel
icon={error ? <error /> : label.step}
error={true}
stepiconprops={{
classes: {
root: classes.step,
completed: classes.completed,
active: classes.active,
error: classes.error,
disabled: classes.disabled
}
}}>
<div classname={classes.steplabelroot}>
<typography classname={classes.label}>
{label.label}
</typography>
<span classname={classes.sublabel}>
{label.sublabel1}
</span>
<span classname={classes.sublabel}>
{label.sublabel2}
</span>
<span classname={classes.sublabel}>
{label.sublabel3}
</span>
</div>
</steplabel>
</step>);
})}
</stepper>
Source: stackoverflow.com
Related Query
- Change Material UI Stepper icon for error step
- How to change Material UI stepper background color if there is an error in a step
- How to change icon size on Alert in Material UI for React
- Material UI Stepper using custom icon deletes the step number. how to add the number or random text back with a custom icon?
- Material UI's Stepper Component's error state showing unwanted icon
- React testing library on change for Material UI Select component
- Change color of Select component's border and arrow icon Material UI
- How do you change the Stepper color on React Material UI?
- Compile error using the Component Lab > Autocomplete feature for SVG Icons in Material UI
- color change for the loading bar component of material ui
- How to change text, icon and underline color of Select in Material UI
- Material ui: How to change DatePicker text and calendar icon color?
- How to change the language for KeyboardDatePicker material ui?
- How to change the style of sorting icon in Material UI table?
- how to change material table action fields icon
- React + Typescript error for material ui icons
- How can I change the icon in material-ui date picker for React
- Material UI Textfield Can't Change Font Size for Multiline
- How to change color icon of Nativeselect Material UI?
- Material UI v1.0.0 how to override Stepper classes to set icon size
- Change scroll button Icon on Material UI Tabs component
- Is there a way to use custom icon for material ui's pagination
- How to change numbers in material ui stepper to alphabet like a,b,c,d
- Getting an error when trying to trigger a function for state change
- How can i change the error message in Firebase? For example, when invalid password is entered?
- Material UI: TextField Alarm Clock change to Another Icon
- Material UI - Custom step connector on stepper
- How do I use the error prop and css for Input API of Material UI with context
- React Material-ui library Error Received `true` for a non-boolean attribute `active`. while using Stepper component
- Material UI - Button inside stepper step
More Query from same tag
- KeyboardDatePickerExample: Onchange set date as moment.utc() in State, when rendering display as moment.local() in React
- How to implement button disable function or other technique so that user does not log in twice? react, express
- using connect of react-redux but error in this.props.tableList is not a function
- make a multi-selector that gets The state first then the city . React
- TypeError: Failed to execute 'fetch' on 'Window'
- Differences between defining shallow in describe block and in every test block?
- How to reset to initial coordinates after some drag operation with the library react-cytoscape.js
- How to set component state conditionally
- React: checker is not a function
- Two dispatch calls in mapDispatchToProps function
- process.env.NODE_ENV is undefined in one project, but not another
- Changing State In React
- when php back-end get param values show Array ( [id] => [object Object] ), how to get the real value?
- How do I get a value from a component and console log it on Submit? (React)
- How to use hover not included in the react code?
- React unit test getting TypeError: Cannot read properties of undefined (reading 'Component')
- Trouble having Heroku recognize gitignored api keys in react app
- Why am I getting Invariant Violation: Invariant Violation: Maximum update depth exceeded. on setState?
- Post request from React to Node/ Express is console logging an empty object
- Overlap Left Part Input using Styled Components in React
- How to check if image is not vallid in react?
- Making reusable component for array data in reactjs
- How to make changes by using onChange using <select> in React?
- How do I type the props for a HOC which will wrap react router's Route component
- React JSON object unpacking correctly and show it on UI
- Return back to first slide when carousel reaches last
- How to animate the height and width using transforms?
- Using Private Use Area Characters with ReactJS
- How to set react-final-form onSubmit values param type TypeScript
- Why is componentDidMount not being called when I re-render?