score:3
Accepted answer
{firsthalfy1.map(month => (<div key={your key}><field/><component2/></div>))}
you need a wrapper for those components, such as a div
or react.fragment
. plus you need a key for each month.
score:1
you can use from fragment like this: <>... this empty tag is also fragment
{firsthalfy1.map(month => (
<react.fragment key={month.id}>
<field {...month}/>
<component2/>
</react.fragment>
))}
Source: stackoverflow.com
Related Query
- Multiple tags in list.map() syntax for React
- Map method for multiple indexed array values for react
- Attempting to learn React and Javascript but stuck on this strange syntax for map and passing an anonymous function to it
- Multiple path names for a same component in React Router
- syntax highlighting for react code in sublime
- Can you use es6 import alias syntax for React Components?
- Can a react component have multiple areas for child content?
- Why is arrow syntax preferred over function declaration for functional React components?
- how to create React search filter for search multiple object key values
- React batch updates for multiple setState() calls inside useEffect hook
- For a React app, can the build process not create a JavaScript map file?
- React Syntax Error : Expected corresponding JSX closing tag for <img>
- TypeScript & React - one onChange Handler for multiple input fields
- React useCallback hook for map rendering
- How to use React Hooks Context with multiple values for Providers
- how to get list of all registered synthetic event handlers/listeners for a React Component?
- What is the syntax for click events in React Hooks for passing arguments
- Better aproach for destructing Custom React Hooks with multiple returns?
- React native List View onEndReached calling multiple times
- Wait for multiple async calls to finish before React render
- React Material Table action button markup overriding for multiple actions
- React Native Inline style for multiple Text in single Text With Touch effect
- Filter The List Using Multiple CheckBoxes in React Js
- react password eye icon for multiple fields
- Create React App for multiple apps?
- React | Single onchange method for multiple dynamic select box
- How to have different style for items at certain locations in a list in React Native?
- React native buld failed with the following message Failed to list versions for com.facebook.react:react-native
- React onClick event for multiple divs
- How to use one vendor chunk file (webpack) for multiple react projects
More Query from same tag
- get the element of active tab item to show borderline
- How to set focus to an antd Input.Password component?
- Function called too fast on 'selector' component "onChange"
- @testing-library/react-hooks calls setTimeout two times
- How to override MUI 5 input label background color for custom component
- How to stop the for loop inside useEffect in react js?
- Cloudinary responsive images only displaying on window size change in React using Webpack
- Getting "You do not have permission to view this directory or page." after deployment on azure for react and node.js
- Dynamic breadcrumbs using react router
- Cannot link to index.js(main page) of next.js app
- How to change fetch API link for deployment?
- Can't get data via filter () in mongodb
- Binding data for React component from external API
- unable to correct the error of Unexpected token, expected ":" in reactjs
- Dynamic className together with a fixed class name in a custom component
- React js: run effects (useEffect) with common concerns synchronously
- Center modal horizontally without jquery
- useContext clear when logout function react js
- react-datepicker includeTimes option
- How use component react created with enzyme example mocha in browser?
- I am not being able to change the state of my state objects in React.js
- Wrong data from client passes GraphQL validation
- Clearing cache on logout with Apollo Client
- React Loading New Page
- How can I use React Router to change routes from within a component that is also Routed in the Main App.js component?
- React not recognising an imported array
- "Res.redirect" Not Working when making Ajax call from React to Node?
- Try to map over an array of url images to render to cards using map
- Modifying data from redux when connecting it to component
- Clear Interval on hover React