score:1
Accepted answer
const socialnetworks = [
{ url: 'http://www.facebook.com', icon: iconfb },
...
];
const social = () => (
<ul>
{
socialnetworks.map(({ url, icon }) => (
<li key={url}><a href={url} target="_blank"><img src={icon} /></a></li>
))
}
</ul>
);
Source: stackoverflow.com
Related Query
- How to create a React Loop inside a component for LI items containing a picture and URL?
- How to create new divs inside for loop and show the result in React
- How can I create a parent component for specific pages (to be able to add react context inside parent)?
- How do I create an array of objects in a React class component through a for loop to be mapped in a functional component?
- how can I create a react component for paypal in-context express checkout?
- How to create a React component for a bootstrap alert?
- How to create seperate component just for routes using react router?
- How do I create a class decorator for mixing new methods into a React component when using Typescript?
- How to create React component with components inside it?
- How to Render Nested Map Items inside react component
- react - create x number of component instances with for loop
- How to fetch data from API for multiple items in React JS component
- How to create a loader page for a react component that is fetching data from an api
- How to put data inside a customize state in for loop in functional component
- How to create array list from for loop in react
- How can I create multiple instances of a React component (having an infinite animation) with different values for the :root variables
- how can i loop through the array inside of an object. and render it in the react component
- How to test the style inside the CSS class for React component using Jest and Enzyme?
- How to write test case coverage in Jest and Enzyme for indexOf used inside React Component
- How to stop the for loop inside useEffect in react js?
- How to use for loop inside <div> in React
- React functional component inside a loop calls api only returns the response for last element passed on api
- How to create a specified callback function for a setState in React Functional Component
- How to get rid of underline for Link component of React Router?
- How to create unique keys for React elements?
- How to test style for a React component attribute with Enzyme
- Figuring out how to mock the window size changing for a react component test
- How to use an array as option for react select component
- How to loop over a number in React inside JSX
- React & Jest, how to test changing state and checking for another component
More Query from same tag
- A component is changing the default value state of an uncontrolled Slider after being initialized. Material UI Slider with Redux State
- When I run AudioBufferSourceNode.start() when I have multiple tracks, I sometimes get a delay
- Scroll when hover arrow - like amazon website
- React cookies not being stored in Chrome but are in Firefox
- React: how to change the state if something outside the react app changes?
- Nested route not working in React
- How to handle "polymorphic" function components
- React useEffect cleanup function depends on async await result
- Converting componentWillReceiveProps function to react hooks
- React.js render components two different elements
- Ant design Area chart - remove canvas margins
- Mocking Submit of final-form in react
- Error: Uncaught [TypeError: Cannot read property 'x' of undefined Jest react testing
- Import JSON file in React
- Looping through table data React JS
- How to remove page from the sitemap file generated by react-static?
- Add dot notation to React.createElement
- React JS maintain array inside state
- Errors on grunt build using google-api-nodejs-client with webpack
- Shows random number enqueuesnackbar (notistack) in react js
- Debounce Input while performing a query in `urql` GraphQL Client in React.js
- Exposing React Component Functions
- Using hooks in inner Component
- How to update nested state properties in React
- Issue in validation in react autocomplete in multiple select using formik
- Compiler warning "Module not found: Error: Can't resolve './locale'" since I use momentjs in my react app
- Unable to get dropdown value in reactjs
- Force one selection checkboxe with REACT
- How to adjust a card image with React and CSS
- Setting conditional onClick behaviour in ReactJS