score:1
Accepted answer
you should return an array of objects for the datasource
. try the following..
_.map(this.props.fetchicon.icons, (icon) => {
return {
text: icon.name,
value: <menuitem primarytext={icon.name} secondarytext={icon.name} />
}
});
Source: stackoverflow.com
Related Query
- How to pass an array to material-ui dataSource props
- How can I pass both the theme and the props in the styled() of Material UI-5?
- React: How to pass an array as props and render a list of images?
- how to pass props into component from route array in react
- How to map over an array and pass it as props to child component correctly in React?
- How to pass props only to first element in array of React elements?
- How to pass props on mapped array of routes in React Js
- How in Material UI to pass a props or a condition to a nested style method
- How to pass props to Material UI class
- How to pass props while routing on click of Listitem of Material UI using v6
- How can I pass a multidimensional array as props in React?
- How to pass props to a component mapped from an array of components?
- How to pass a json array that comes from backend to child component using props and react hooks?
- How to pass an array as props in React without being converted to string
- Reactjs Material: How to pass to props to reactjs material dialog
- How to pass an array as props in React component and use map on it?
- how do i pass props to styled components and map through array of image objects
- How to pass props to {this.props.children}
- How to pass all other props to react class?
- React - How to pass props to a component passed as prop
- How to pass props without value to component
- How to pass several props in spread operator in react
- How to pass props to Screen component with a tab navigator?
- How to pass props to keyframes in styled-component with react?
- How to pass props to component inside a React Navigation navigator?
- React useReducer Hook fires twice / how to pass props to reducer?
- How can I pass props down in Angular 2+ like React?
- (react-window) How to pass props to {Row} in <FixedSizeList>{Row}</FixedSizeList>
- How to pass props to 'screens'/components in react-navigation
- How to pass props to a styled component in emotion? Using TypeScript
More Query from same tag
- Redux form: REGISTER_FIELD / UNREGISTER_FIELD get called after change or focus events
- onClick function requires two clicks to update state
- CSS/React My button moves out of place when minimizing window
- How do I make a react app in docker-compose? Container is exiting after build steps are complete
- React Native UI components: RCTBubblingEventBlock/RCTDirectEventBlock do not seem to work
- How to return Objects with Object.keys Javascript
- React implicit mapping mechanism
- react: Show javascript inside render as plain text
- How can I pull a specific object from the state and get one of its items?
- webpack including react 0.14-beta2 twice in final bundle
- POST request is working fine with postman but not in website
- Why does my axios request print in console but doesn't set state
- Wrapping async moxios call in act callback
- How to dynamically add and remove mapped array to another array when clicked and remove from arr when clicked again in reactjs
- fix nextjs component level scss issue
- React 18 strict mode causing component to render twice
- Change styles of component when hovering sibling
- multiple react useState calls gives undefined property
- Adjacent JSX elements must be wrapped in an enclosing tag with line break tag
- Ipad React play 2 sounds at the same time
- Hookrouter (react) changes url but not the view, only after refreshing the page by yourself
- Customize Material UI animations durations
- How to use map function on react state hook
- Using use-sound in React and Gatsby.js - How to stop audio playing on route change?
- Why need useRef and not mutable variable?
- React and JavaScript: Calling setState() Only Once to Update State
- How to pass argument to the state callback function in react
- CDN-script in Helmet does not always load properly
- Call a function in react component, WITHOUT event handlers or props
- Preparing strings to be passed into API query (escaping special characters)