score:0
you need to add the state being controlled as a 'value' prop to both components, to have them syncronised.
<slider
value={currentvalueradio} // <- add a value prop
defaultvalue={2021}
...
adding the value prop in your example will have both components react to the same state value. however, since the radio components set the value to 1 or 2, and the range on the slider is from 2021 to 2022, you may not see the result you're looking for. perhaps change the radio values to 2021 and 2022 respectively.
Source: stackoverflow.com
Related Query
- ReactJS + Ant Design: hook up two AntD components
- Ant Design Components - Inside function of antd components "this" is undefined
- ReactJS with ES6: this.props is not a function when I communicate two components
- antd - ant design table with pagination control supporting a widget to choose rows per page?
- React Router with - Ant Design Sider: how to populate content section with components for relevant menu item
- ReactJS - ant design - Fix Footer with Layout
- ReactJS Ant design select component mock change event
- CSS Modules + Ant design in ReactJs does not work
- Pagination and Card Components with Ant Design (antd)?
- ReactJS Ant Design - Open DatePicker on button click
- Using Ant Design Variables in Styled Components
- Change Ant Design variables using ReactJs
- Recreate Ant Design Pro like Sider/Drawer in Antd React App
- ReactJS Ant Design - Disable dates less than any default date in DatePicker
- Ant Design react - change default spinner for all components
- Toggle between two components /buttons using react toggle hook {Show one component and Hide another}
- reactJs : Communication between two different components
- How to add custom components into Ant Design stepper?
- Communicate between two components reactjs
- How to import Ant design on demand to work with components which does destructuring?
- open ant design popover from two link
- How to pass an element between two components in reactJS
- Ant Design components style not loading correctly
- ReactJS two different components
- ReactJS - how create two or more components in same page
- In Reactjs how to insert api data into ant design table
- How to remove duplicate Ant Design components across chunks
- Loading styles in ant design ui for react components
- ReactJS - Custom hook to create a single object with the data collected from multiple form components
- ReactJS Warning: Encountered two children with the same key after changing components
More Query from same tag
- How to properly structure full-stack project which use React?
- React - update state only for the clicked element
- Why are these children as array not rendered in TS?
- post.frontmatter.title.filter is not a function
- TypeError: instance.render is not a function
- Make React useEffect hook not run on initial render
- Unable to access state
- React stop other events on that element
- map function reducing index not working (with React)
- React, how to return a value from function to component?
- How to push data as an array of an index to firebase?
- Cannot call a method in the class
- Not able to set initial values and onchange of input elelements in DataTable React Js
- Why does my setInterval run only once in react hooks?
- How to integrate skylink in react project?
- How to pass props into jest test in React
- useState and map - React
- How to implement conditional Redirects in ReactJS?
- Apollo client - local field with computed value from object
- Object(...) is not a function
- how to give string value on y axis in rechart
- React user session automatic logout after one hour
- Parent component re-mounting when react-router switching links
- How does one programmatically 'open' a Material-UI Select field?
- useContext values return undefined in testing
- Jest css-modules SyntaxError: Unexpected token
- Accessing Select Text Value from Formik Select
- How to alert a Selected Record using Reactjs
- React + Docker + Nginx
- Returning correct value using react-select and react-hook-form