score:1
Accepted answer
i was able to accomplish that by adding a property checked
to the source of truth (items), and using the selectablegroup
handler onselectionfinish
which returns an array of selected components (refs)
<selectablegroup ... onselectionfinish={this.handleselectionfinish} />
handleselectionfinish= (obj) => {
let updateditems = [...this.state.items];
for (let i = 0; i < updateditems.length; i++) {
let item= updateditems[i];
let selecteditem = obj.find(k => k.props.id === item.id)
item.checked = selecteditem !== undefined;
}
this.setstate({ items: updateiitems })
}
Source: stackoverflow.com
Related Query
- React Selectable Fast: how to set and get checked items from a list of selectable items
- How to get and display all child list from Firebase React
- React js how to set and get parameter from another file?
- how to get data from localstorage and set state react
- How to set React component state and props from browser
- How do I use React and forms to get an array of checked checkbox values?
- How to get image height and width from uri on React Native?
- How does Express and React Routes work on initial GET request from browser?
- How to set checked items to React state array
- How do I combine two arrays in react to get a new one with all of the items from the previous two?
- In React Hooks. How to set state to a random number and use that to display a string from an array
- Django Rest Framework and React Front End: How to prevent unauthorized users from viewing private images if they get a hold of the image URL?
- How to iterate through a list of objects from api and render it to jsx page React functional component
- how to get images from mongo with axios and display them with react
- get a random item from a list of items with property by React js
- in React i need to get the state from local storage and then set another state conditionally based on this state
- How can I render list items dynamically and recursively from a nested array?
- how to set ref in list of items react js?
- How to render and add similar item to the list of items from the api in React.js?
- HandleCheckBox react checked and unchecked , get a list into a state
- How can I manage a list from Parent component in React and render it?
- How to properly set property(if user is logged) from cookie after page opens or F5 in React with router and redux
- How to change the checkbox selection and get the updated id's of checkbox items in form submit in React Component?
- How should I pass data from react app.js to profile.js and set id in url?
- React Material-UI get list of items checked
- react native - How can get the list of "dog" from the sqlite table?
- How pass value in URL and How get value from URl in React JS
- How to get data from API and turn it into array list for Google Charts
- How to get total of numbers in an array from SharePoint list items
- How to get only one set state function from use state or some other hook React JS,
More Query from same tag
- How to show all my arrays with Firebase and React?
- Material-ui classes name changes on build, adds identifiers to each class name that are overriden by user
- Problems with react for animation
- react component method binding with arrow function (class properties)
- Is there a create-react-app alternative for Preact?
- controlled radio button warning handling it's value with formik field
- How to run react on browser?
- Frontend Authenticated request Google Cloud Storage
- Render SVG from URL for animation with Velocity.js
- Change content in div based on logic using React
- React JS Adding a conditional loops in react map function
- How to play animation only when the element is on screen
- Asp.Net Core API CORS policy error (+308 status code)
- Why is my functional component's state undefined?
- Axios & Redux returns undefined, than resolves
- After Simulate('change') state is not updated
- ReactTransitionGroup Lower Level API
- How to make a React component that accepts value like a HTML tag instead of taking it from attributes
- How i can remove react-native button shadow?
- How to pass data from functional component to class component in reactjs?
- Why is react-single-page-navigation only working in Components without constructor and state?
- page/static graphql query becomes empty after page navigation
- How to modify axios instance after exported it in ReactJS?
- Dynamically Rendering a React component
- How to retrieve selectedRows from a material-table in React
- How to enable absolute imports in eslint when extending airbnb?
- In ES6 with react, can I destructure an object just once for use in multiple methods?
- Multiple Redux states in a single component - Typescript, React, Redux
- Using filter on 'this' in Reactjs
- unable to update hooks variable when fetching multiple urls in react