Recharts data not updating on the chart when using the slider - reactjs

I am trying to display a dot that moves on the line when I use the slider (SliderWidget.js) but nothing is happening. I did the console.log() to see if it works and it does but on the chart (I am using Recharts library) nothing happens.
import SliderWidget from "../SliderWidget";
import { LineChart, Line, XAxis, YAxis, CartesianGrid } from "recharts";
import { useState } from "react";
const LongitudinalCoG = () => {
const [chartValue, setChartValue] = useState([
{
data: [
{ x: 1000, y: 2000 },
{ x: 3000, y: 3500 },
{ x: 4000, y: 4500 },
{ x: 4100, y: 4200 },
],
},
{
//this is the little dot on the chart
data: [{ x: 2000, y: 2500 }],
},
]);
console.log(chartValue);
function sliderData(newValue) {
chartValue[1].data[0].x = newValue;
setChartValue(chartValue);
console.log(chartValue);
}
return (
<div>
<LineChart
width={500}
height={300}
data={chartValue}
margin={{
top: 5,
right: 30,
left: 20,
bottom: 5,
}}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="x" />
<YAxis dataKey="y" />
<Line
dataKey="y"
data={chartValue[0].data}
stroke="white"
dot={{
r: 1,
}}
/>
<Line
dataKey="y"
data={chartValue[1].data}
stroke="blue"
dot={{
r: 3,
}}
/>
</LineChart>
<SliderWidget
minValue={chartValue[1].data[0].x}
maxValue={chartValue[1].data[0].y}
sliderTitle={"Override (mm)"}
onValueChanged={sliderData}
/>
</div>
);
};
export default LongitudinalCoG;
this is the SliderWidget component
import { useState } from "react";
import { Slider, InputNumber } from "antd";
import Icon from "#mdi/react";
import { mdiPlus, mdiMinus } from "#mdi/js";
import "../styles/Expanded.css";
const SliderWidget = (props) => {
const [inputValue, setInputValue] = useState(0);
const onChange = (newValue) => {
setInputValue(newValue);
props.onValueChanged(newValue);
};
function increment() {
if (inputValue + 1 < props.maxValue) {
setInputValue(inputValue + 1);
}
}
function decrement() {
if (inputValue - 1 > props.minValue) {
setInputValue(inputValue - 1);
}
}
return (
<div>
<div className="slider-title">
{props.sliderTitle}
<InputNumber
className="input-number-helicopter"
style={{ width: "40px", marginBottom: "10px", marginTop: "10px" }}
value={inputValue}
onChange={onChange}
controls={false}
/>
<div className="increment-decrement-container">
<button className="increment-button" onClick={increment}>
<Icon path={mdiPlus} size={"1rem"} color={"#FFFFFF"} />
</button>
<button className="decrement-button" onClick={decrement}>
<Icon path={mdiMinus} size={"1rem"} color={"#FFFFFF"} />
</button>
</div>
</div>
<div>
<Slider
className="slider-helicopter"
minValue={1}
maxValue={4000}
onChange={onChange}
value={inputValue}
/>
</div>
</div>
);
};
export default SliderWidget;
This is the chart. I want to make the litle dot move on the white lines when I use the slider or the increment/decrement buttons
As I said, I run the console.log() and it is working but it is not showing on the chart!

Related

Why does this bar chart refresh when the others do?

I'm sorry for not being good at English.
Using the KendoUI React demo, I've encountered a weird issue with the bar charts.
I gave each chart an interval of 3, 5, or 10 seconds, intending that each one refreshes by 3 seconds, 5 seconds, and 10 seconds.
But when I turn on the dev mode and confirm it, the charts refresh together every second the other chart does.
FYI, This code is to be child components into a map of the parent component, so I cannot divide that component by each page.
I hope to get a good answer to this situation.
pages/disk-index
import { Chart, ChartTooltip, ChartSeries, ChartSeriesItem } from '#progress/kendo-react-charts';
import { useState, useEffect, useRef } from 'react';
import Disk from './disk';
export default function Home() {
const intervalDisk = useRef(null);
const diskData1 = [{ categoryField: 'root', value: 40, color: 'blue' }];
const [diskData1State, setDiskData1State] = useState(diskData1);
const isClient = typeof window === 'object';
useEffect(() => {
if (isClient) {
intervalDisk.current = setInterval(() => {
diskData1[0].value = Math.floor(Math.random() * 100);
// console.log(new Date() + ', ' + diskData1[0].value);
setDiskData1State(JSON.parse(JSON.stringify(diskData1)));
}, 10000);
return () => clearInterval(intervalDisk.current);
}
}, []);
return (
<>
<Disk diskId="1" interval="3000" />
<Disk diskId="2" interval="5000" />
<div id="diskDataId2">
<Chart
style={{
width: '90%',
height: '85%',
position: 'center center',
}}
>
<ChartTooltip />
<ChartSeries>
<ChartSeriesItem
type="bar"
stack={{
type: 'normal',
}}
gap={2}
spacing={0.35}
categoryField="categoryField"
colorField="color"
data={diskData1}
tooltip={true}
/>
</ChartSeries>
</Chart>
</div>
</>
);
}
pages/disk
import { Chart, ChartTooltip, ChartSeries, ChartSeriesItem } from '#progress/kendo-react-charts';
import { useState, useEffect, useRef } from 'react';
export default function Disk(props) {
console.log(JSON.stringify(props));
const intervalDisk = useRef(null);
const diskData1 = [{ categoryField: 'root', value: 40, color: 'red' }];
const [diskData1State, setDiskData1State] = useState(diskData1);
useEffect(() => {
intervalDisk.current = setInterval(() => {
diskData1[0].value = Math.floor(Math.random() * 100);
// console.log(new Date() + ', ' + diskData1[0].value);
setDiskData1State(JSON.parse(JSON.stringify(diskData1)));
}, Number(props.interval));
return () => clearInterval(intervalDisk.current);
}, [diskData1State]);
return (
<>
<div id={'diskData' + props.diskId}>
<Chart
style={{
width: '90%',
height: '85%',
position: 'center center',
}}
>
<ChartTooltip />
<ChartSeries>
<ChartSeriesItem
type="bar"
stack={{
type: 'normal',
}}
gap={2}
spacing={0.35}
categoryField="categoryField"
colorField="color"
data={diskData1State}
tooltip={true}
/>
</ChartSeries>
</Chart>
</div>
</>
);
}
enter image description here

Material UI Custom Hover Color

Haven't made this feature before where you can change the color of button's hover.
I have already made a feature to change the radius with a slider, background color and font color using color-picker. However, I noticed the hover (for background AND font) could be better.
Here is the code:
import React from "react";
import { makeStyles } from "#material-ui/core/styles";
import Grid from "#material-ui/core/Grid";
import Slider from "#material-ui/core/Slider";
import Input from "#material-ui/core/Input";
import Button from "#material-ui/core/Button";
import { ChromePicker } from "react-color";
const useStyles = makeStyles((theme) => ({
root: {
"& > *": {
margin: theme.spacing(1)
}
},
Button: {
width: 150,
height: 50,
borderRadius: "var(--borderRadius)"
},
color: {
width: "36px",
height: "14px",
borderRadius: "2px"
},
swatch: {
padding: "5px",
background: "#fff",
borderRadius: "1px",
display: "inline-block",
cursor: "pointer"
},
popover: {
position: "absolute",
zIndex: "2"
},
cover: {
position: "fixed",
top: "0px",
right: "0px",
bottom: "0px",
left: "0px"
}
}));
export default function InputSlider() {
const classes = useStyles();
const [value, setValue] = React.useState(30);
const [color, setColor] = React.useState({ r: 0, g: 0, b: 0, a: 1 });
const [fontColor, setFontColor] = React.useState({
r: 255,
g: 255,
b: 255,
a: 1
});
const [displayColorPicker, setDisplayColorPicker] = React.useState(true);
const handleSliderChange = (event, newValue) => {
setValue(newValue);
};
const handleInputChange = (event) => {
setValue(event.target.value === "" ? "" : Number(event.target.value));
};
const handleBlur = () => {
if (value < 0) {
setValue(0);
} else if (value > 30) {
setValue(30);
}
};
const handleClick = () => {
setDisplayColorPicker(!displayColorPicker);
};
const handleClose = () => {
setDisplayColorPicker(false);
};
const handleChange = (color) => {
setColor(color.rgb);
};
const handleFontColorChange = (color) => {
setFontColor(color.rgb);
};
return (
<div className={classes.root}>
<style>
{`:root {
--borderRadius = ${value}px;
}`}
</style>
<Button
style={{
borderRadius: value,
background: `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`,
color: `rgba(${fontColor.r}, ${fontColor.g}, ${fontColor.b}, ${fontColor.a})`
}}
variant="contained"
color="primary"
value="value"
onChange={handleSliderChange}
className={classes.Button}
>
Fire laser
</Button>
<Grid container spacing={2}>
<Grid item xs>
<Slider
value={typeof value === "number" ? value : 0}
onChange={handleSliderChange}
aria-labelledby="input-slider"
/>
</Grid>
<Grid item>
<Input
value={value}
margin="dense"
onChange={handleInputChange}
onBlur={handleBlur}
inputProps={{
step: 10,
min: 0,
max: 24,
type: "number"
}}
/>
</Grid>
</Grid>
<div>
<div style={useStyles.swatch} onClick={handleClick}>
{displayColorPicker} <p class="h4">Background</p>
<div style={useStyles.color} />
</div>
{displayColorPicker ? (
<div style={useStyles.popover}>
<div style={useStyles.cover} onClick={handleClose}></div>
<ChromePicker color={color} onChange={handleChange} />
</div>
) : null}
</div>
<div>
<div style={useStyles.swatch} onClick={handleClick}>
{displayColorPicker} <p class="h4">Font</p>
<div style={useStyles.color} />
</div>
{displayColorPicker ? (
<div style={useStyles.popover}>
<div style={useStyles.cover} onClick={handleClose}></div>
<ChromePicker color={fontColor} onChange={handleFontColorChange} />
</div>
) : null}
</div>
</div>
);
}
And here is the sandbox - https://codesandbox.io/s/material-demo-forked-t8xut?file=/demo.js
Any advice?
Does anyone have a good Material UI article for editing/cool features and projects to play with?
You need to pass props to makeStyles.
First, pass fontColor variable as below when declaring classes:
const classes = useStyles({ hoverBackgroundColor, hoverFontColor })();
then in the useStyles, you can have access to the fontColor as a prop, as below:
const useStyles = ({ hoverBackgroundColor, hoverFontColor }) =>
makeStyles((theme) => ({
Button: {
width: 150,
height: 50,
borderRadius: "var(--borderRadius)",
"&:hover": {
backgroundColor: `rgba(${hoverBackgroundColor.r}, ${hoverBackgroundColor.g}, ${hoverBackgroundColor.b}, ${hoverBackgroundColor.a}) !important`,
color: `rgba(${hoverFontColor.r}, ${hoverFontColor.g}, ${hoverFontColor.b}, ${hoverFontColor.a}) !important`
}
},
sandbox

Recharts how to display an additional diagonal line with different data set to a line chart

What I am trying to do is the following:
But I can't manage to get it working. I was able to get the data to read in from 2 different data sources but it somehow does not render the second line properly on the x-axis.
Here is the example code:
import React from "react";
import { render } from "react-dom";
import { LineChart, Line, XAxis, YAxis, ReferenceLine } from "recharts";
const styles = {
fontFamily: "sans-serif",
textAlign: "center"
};
const data = [];
const maxBudget = 300;
for (let i = 0; i < 20; i++) {
let d = {
day: i,
value: Math.random() * (maxBudget + 50) + 100
};
data.push(d);
}
const testline = [{ x: 0, y: 300 }, { x: 20, y: 0 }]
const App = () => (
<div style={styles}>
<LineChart
width={500}
height={300}
margin={{ top: 5, right: 20, bottom: 5, left: 0 }}
>
<Line type="monotone" data={data} dataKey="value" stroke="#8884d8" dot={false} />
<Line type="linear" data={testline} dataKey="y" stroke="#FF3333" dot={false} strokeWidth={2} />
<XAxis dataKey="day" type="number" tickCount={11} />
<YAxis />
<ReferenceLine
y={maxBudget}
label={{
position: "center",
value: "Max budget"
}}
strokeDasharray="5 5"
/>
</LineChart>
</div>
);
render(<App />, document.getElementById("root"));
ok I m stupid. I just found it out by myself. Sometimes you don't see the wood for the trees for days :(.
The x value must be the same as defined in the XAxis so I had to change x:0 to day:0:
const testline = [{ day: 0, y: 300 }, { day: 20, y: 0 }]
Now it works

React Konva: onClick() not firing in functional component

I am trying to create an onClick event on an image in a functional component which is the grand-child of the component where I have my Konva Stage.
However nothing seems to fire.
I have even tried putting the onClick on a div in the component with the stage. Still nothing.
The only way I can handle clicks is if I put an onMouseDown on my stage. But that is not practical in this instance, since I need the click to trigger a change in the grandchild component.
Why will nothing trigger?
Here is the code. I have cut away irrelevant code and functions.
Look in the PanelRect.js component to find the onClick() that is supposed to trigger the select() function.
First off, this is the grandparent, with the Konva stage.
Map.js
import React, { useState } from 'react';
import Konva from 'konva';
import { Stage, Layer, Image } from 'react-konva';
import { keyHandler, KEYPRESS } from 'react-key-handler';
import MapRoomRect from './MapRoomRect';
import { PanelRect } from './PanelRect';
const Map = () => {
return (
<section className='map'>
<h1>Projekt X</h1>
<div className='map_box'>
<div className='map_box_container' >
<div className='map_box_container_stage'>
<Stage name='Stage' width={stageWidth} height={stageHeight} onMouseDown={handleStageMouseDown} onKeyPress={handleKeyDown}>
<Layer
onMouseEnter={handleLayerMouseEnter}
onMouseLeave={handleLayerMouseLeave}
>
<MapRoomRect
name='MapRoomRect'
draggable
visible={false}
/>
<Image name='IconImage' draggable visible={false}/>
</Layer>
</Stage>
</div>
</div>
</div>
</section>
);
}
export default Map;
This is the parent component
MapRoomRect.js
import React from 'react';
import { Rect, Group, Image } from 'react-konva';
import useImage from 'use-image';
import { PanelRect } from './PanelRect';
const MapRoomRect = (props) => {
return (
<Group
name='RoomGroup'
roomType='RoomType'
id='0002'
onDragEnd={() => { }}
position={{ x: 200, y: 200 }}
draggable
visible={false}
size={{ width: roomSize, height: roomSize }}
>
<Rect
name='RoomGroupBackground'
size={{ width: roomSize, height: roomSize }}
opacity={0.3}
fill='red'
/>
<PanelRect
name='PanelGroup'
onDragEnd={() => { }}
size={{ width: iconSize, height: iconSize2 }}
x={0}
y={0} />
</Group>
)
}
export default MapRoomRect;
The child / grand-child component:
PanelRect.js
import React, { useState } from 'react';
import { Rect, Group, Image } from 'react-konva';
import useImage from 'use-image';
// Images
import backgroundImage from '../../images/tp6icon.png';
import iconTestImage from '../../images/lo1.png';
import iconTestImage2 from '../../images/lo2.png';
import iconTestImage3 from '../../images/lo3.png';
import iconTestImage4 from '../../images/lo4.png';
import iconTestImage5 from '../../images/lo5.png';
import MapContext from './MapContext';
const PanelRect = (props) => {
// Hooks
const [mapState, setMapState] = useState(mapContext);
let los = [0, 0, 0, 3, 4];
// Hooks
const [testImage] = useImage(iconTestImage);
const [testImage2] = useImage(iconTestImage2);
const [testImage3] = useImage(iconTestImage3);
const [testImage4] = useImage(iconTestImage4);
const [testImage5] = useImage(iconTestImage5);
var images = [testImage,testImage2,testImage3,testImage4,testImage5];
// Constants that does not change
const roomSize = 5;
const roomSize2 = 7;
const iconSize = 2;
const iconSize2 = 2;
const select = (e) => {
console.log('Hi! "e" is now: ' + e + ' hmmm');
}
return (
<Group
name='PanelGroup'
roomType='PanelType'
id='0003'
onDragEnd={() => { }}
position={{ x: 0, y: 0 }}
draggable
size={{ width: roomSize, height: roomSize2 }}
>
<Rect
name='PanelGroupBackground'
size={{ width: roomSize, height: roomSize2 }}
opacity={0.9}
fill='blue'
/>
<Image name='IconImage' lid='LO1' lo='0' className='imageAnchor' onDragEnd={() => { }} onClick={() => {select()}} image={images[los[0]]} size={{ width: iconSize, height: iconSize }} draggable={false} x={0} y={0} />
<Image name='IconImage' lid='LO2' lo='1' className='imageAnchor' onDragEnd={() => { }} onClick={() => {select()}} image={images[los[1]]} size={{ width: iconSize, height: iconSize }} draggable={false} x={2} y={0} />
<Image name='IconImage' lid='LO3' lo='2' className='imageAnchor' onDragEnd={() => { }} onClick={() => {select()}} image={images[los[2]]} size={{ width: iconSize, height: iconSize }} draggable={false} x={0} y={2} />
<Image name='IconImage' lid='LO4' lo='3' className='imageAnchor' onDragEnd={() => { }} onClick={() => {select()}} image={images[los[3]]} size={{ width: iconSize, height: iconSize }} draggable={false} x={2} y={2} />
<Image name='IconImage' lid='LO5' lo='4' className='imageAnchor' onDragEnd={() => { }} onClick={() => {select()}} image={images[los[4]]} size={{ width: iconSize, height: iconSize2 }} draggable={false} x={0} y={4} />
</Group>
)
}
export { PanelRect }
I don't get any error messages or warnings. It's just that nothing happens when I click. No matter where I put the onClick().
Edit 7th aug 2019
I have created a sandbox that shows the problem.
Click "create red square"
Click on the red square.
Click "edit red square"
Click on the blue square inside
Click "edit blue square"
Click on the tiles with numbers on in the blue square.
It is the onClick() on these that I want to fire, and get access to the synthetic event object so I can access the target.
https://codesandbox.io/s/quirky-ramanujan-p53b9?fontsize=14

How to delete a div with id slider using ReactJS?

I am trying to delete div section without using state, how to remove this? I tried by using unmountComponentAtNode but showing the error
unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. Instead, have the parent component update its state and rerender in order to remove this component.
Code:
import 'rc-slider/assets/index.css';
import 'rc-tooltip/assets/bootstrap.css';
import React from 'react';
import Tooltip from 'rc-tooltip';
import Slider from 'rc-slider';
import { withStyles } from '#material-ui/core/styles';
import Icon from '#material-ui/core/Icon';
import { unmountComponentAtNode } from 'react-dom';
const createSliderWithTooltip = Slider.createSliderWithTooltip;
const Range = createSliderWithTooltip(Slider.Range);
const Handle = Slider.Handle;
const marks = {
0: <strong>0°C</strong>,
26: '26°C',
37: '37°C',
50: '50°C',
100: {
style: {
color: 'red',
},
label: <strong>100°C</strong>,
},
};
const handle = (props) => {
const { value, dragging, index, ...restProps } = props;
return (
<Tooltip
prefixCls="rc-slider-tooltip"
overlay={value}
visible={dragging}
placement="top"
key={index}
>
<Handle value={value} {...restProps} />
</Tooltip>
);
};
class StepSlider extends React.Component {
constructor(props) {
super(props);
this.state = { sliderValues: [80] };
this.onDelEvent = this.onDelEvent.bind(this)
}
handleChange = sliderValues => {
this.setState({ sliderValues });
};
onDelEvent = (e) => {
console(e)
var object = this.refs.slider;
unmountComponentAtNode(object);
document.body.removeChild(object);
}
render() {
const { classes } = this.props;
const { sliderValues } = this.state;
return (
<div className="row" style={{ margin: '50px' }} ref="slider" id="slider">
<div className="col-md-11">
<div className="box-header" style={{ textAlign: 'center', fontSize: '20px' }}><strong>Project NPV: $2.98M</strong></div>
<p style={{ position: 'absolute', color: 'pink' }}>kjh</p>
{/* <Slider min={0} max={100} marks={marks} defaultValue={sliderValues} onChange={this.handleChange} handle={handle} tipFormatter={value => `${value}%`}/> */}
<Slider
min={0} max={100} marks={marks} defaultValue={sliderValues} onChange={this.handleChange} handle={handle} tipFormatter={value => `${value}%`}
trackStyle={{ backgroundColor: 'blue', height: 15 }}
handleStyle={{
borderColor: 'red',
height: 35,
width: 35,
marginLeft: -14,
marginTop: -9,
backgroundColor: 'white',
}}
railStyle={{ backgroundColor: 'black', height: 15 }}
/>
</div>
<div className="col-md-1">
<Icon className={classes.icon} color="primary" onClick={this.onDelEvent.bind(this)} style={{ marginTop: '45px' }}>
remove_circle</Icon>
{/* <div style={wrapperStyle}>
<p>Range with custom handle</p>
<Range min={0} max={20} defaultValue={[3, 10]} tipFormatter={value => `${value}%`} />
</div> */}
</div>
</div>
)
}
}
export default withStyles({ withTheme: true })(StepSlider);
I suggest the following pattern for dynamic removal of sliders:
Slider.js
const Slider = ({ id, onRemove }) => (
<div className="slider">
<button onClick={() => onRemove(id)} />
</div>
);
export default Slider;
StepSlider.js
import Slider from './Slider';
class StepSlider extends React.Component {
state = {
sliders: [
{id: 1, value: ...},
{id: 2, value: ...},
...
]
}
handleRemoveSlider = id => {
this.setState(prevState => ({
sliders: [...prevState.sliders.filter(slider => slider.id !== id)]
}))
}
render() {
this.state.sliders.map(slider => (
<Slider id={slider.id} onRemove={this.handleRemoveSlider} />
))
}
}
import 'rc-slider/assets/index.css';
import 'rc-tooltip/assets/bootstrap.css';
import React from 'react';
import Tooltip from 'rc-tooltip';
import Slider from 'rc-slider';
import { withStyles } from '#material-ui/core/styles';
import Icon from '#material-ui/core/Icon';
const createSliderWithTooltip = Slider.createSliderWithTooltip;
const Range = createSliderWithTooltip(Slider.Range);
const Handle = Slider.Handle;
const marks = {
0: '5%',
10: '6%',
20: '7%',
30: '8%',
40: '9%',
50: '10%',
60: '11%',
70: '12%',
80: '13%',
90: '14%',
100: '15%'
};
const handle = (props) => {
const { value, dragging, index, ...restProps } = props;
return (
<Tooltip
prefixCls="rc-slider-tooltip"
overlay={value}
visible={dragging}
placement="top"
key={index}
>
<Handle value={value} {...restProps} />
</Tooltip>
);
};
const handleStyle = {
borderColor: 'red',
height: 28,
width: 28,
marginLeft: -14,
marginTop: -8,
backgroundColor: 'white',
}
class StepSlider extends React.Component {
constructor() {
super()
this.state = {
sliders: [
{ id: 1, title: 'Discount Rate', value: '5' },
{ id: 2, title: 'Total Volume', value: '10' },
{ id: 3, title: 'Avg Sales Rate', value: '50' }
]
}
this.handleRemoveSlider = this.handleRemoveSlider.bind(this);
this.onChange=this.onChange.bind(this)
}
onChange=(e)=>{
let inputValue = e;
let statusCopy = Object.assign({}, this.state);
statusCopy.value = inputValue;
this.setState(statusCopy);
}
handleRemoveSlider = id => {
this.setState(prevState => ({
sliders: [...prevState.sliders.filter(slider => slider.id !== id),
],
}))
}
render() {
return (
this.state.sliders.map(slider => (
<div>
<Button id={slider.id} onRemove={this.handleRemoveSlider} title={slider.title} value={slider.value} onChange={this.onChange}/>
</div>
))
)
}
}
export default StepSlider;
const Button = ({ id, onRemove, value, title,onChange }) => (
<div className="row" style={{ margin: '50px' }} id={id}>
<div className="col-md-1">
{title}
</div>
<div className="col-md-10">
<Slider min={0} max={100} handle={handle}
defaultValue={value} marks={marks}
tipFormatter={value => `${value}%`}
trackStyle={{ backgroundColor: 'blue', height: 15 }}
handleStyle={handleStyle}
railStyle={{ backgroundColor: 'black', height: 15 }}
onChange={onChange}
/>
</div>
<div className="col-md-1">
<button onClick={() => onRemove(id)} style={{ backgroundColor: '#1a237e', color: 'white' }}>X</button>
</div>
</div>
);
Actually this is working, i mean deleting slider by passing its respective id but state is not updating and i wanna update the particular slider value onchanging it. please check and help me

Resources