score:2
Accepted answer
Try this approach,
<ul>
{
data.map((item)=>(
<li
className="col-xs-6 col-sm-4 col-md-4 col-lg-3"
data-src={item?.img}
data-sub-html={`<h4>${item?.title}</h4><p>${item?.desc}</p>`}
>
<a style={{ cursor: 'pointer' }}>
<img className="img-responsive" src={item?.img} alt="Thumb-1" />
</a>
</li> ))
}
</ul>
Source: stackoverflow.com
Related Query
- ReactJS map function not working on a lightbox gallery
- reactjs - Function not working inside a map function
- reactJS map function not working as expected
- Why is map function not working as expected? ReactJS
- map function not working in React
- ReactJS Array.push function not working in setState
- Reactjs handleclick binding in a nested map not working
- Uncaught TypeError: map is not a function In Reactjs with Firebase
- reactjs enable disable button through a function not working
- adding key to map function is not working
- <Helmet> reactJs not working under function cause error
- set state in a function not working - reactJs
- React Js Map function not working on a nested array
- selection limit function not working on checkbox form reactjs
- Map function is not working properly when I hit onClick
- map is not a function in reactJS
- Map function not working while passing props into React component (TypeScript, React and Next.js)
- map function does not return anything in reactjs
- map function not working properly in object React
- OnClick event not working in map function react
- Function setInterval is not working in reactJs
- this.state array in reactjs map is not a function
- onClick={OnButtomSubmit} function not working in ReactJs
- Reactjs map function does not render the component
- map function not working after implementing redux in react
- Map function not able to implement in reactJS app
- map function in javascript not working properly for React components
- for loop not working in render function reactjs
- import module.fucntion working but import { function } from '../../module' not working in ReactJS
- Array map function is not working (not rendering elements in React)
More Query from same tag
- React JS - Login system with Remember LocalStorage
- Unable to change my input types values on edit page
- Handling state after fetching data - React
- How to wrap a React component by React.cloneElement using a function?
- Confused about React's Flux architecture - waitFor
- What can I do to display the function "size" inside the card?
- How to redirect to an external url in React?
- Confusion on React Callback's on Forms
- Hovering an article to make GatsbyImage scale
- React.js how to send array to react router
- Semantic React - Form.Select how to use custom array options
- React.js show detailed info of a list
- How to delay componentDidMount API fetching in React?
- Take this.state to outer scope
- Can't deploy my app to Heroku. Error: clean-webpack-plugin only accepts an options object
- React router 4, path with parameter
- How to show alert only when error message isn“t empty in JavaScript?
- How do I define an array of objects in a state in React Typescript?
- How to apply a pattern to a TextField to only allow specific characters
- Intl.js polyfill/shim with webpack?
- React JS / Typescript passing an updated prop onChange from one component to another component
- How to start BE and FE with one npm script command
- Color picker from react-color doesn't work properly
- react-router-dom v4 Redirect to programatically
- How to Pass an ID to API call using redux saga?
- Calling React hook in a function
- Link react-hook-form Controller to a state value
- React js invariant violation Hooks and Function Components
- How to get temperature units on weather api call?
- React input when focus