Gosha Arinich is right, you should return your <li> element. But, nevertheless, you should get nasty red warning in the browser console in this case

Each child in an array or iterator should have a unique "key" prop.

so, you need to add "key" to your list:

this.state.data.map(function(item, i){
  console.log('test');
  return <li key={i}>Test</li>
})

or drop the console.log() and do a beautiful oneliner, using es6 arrow functions:

this.state.data.map((item,i) => <li key={i}>Test</li>)

IMPORTANT UPDATE:

The answer above is solving the current problem, but as Sergey mentioned in the comments: using the key depending on the map index is BAD if you want to do some filtering and sorting. In that case use the item.id if id already there, or just generate unique ids for it.

Answer from Dmitry Birin on Stack Overflow
🌐
React
legacy.reactjs.org › docs › lists-and-keys.html
Lists and Keys – React
We can refactor the previous example into a component that accepts an array of numbers and outputs a list of elements. function NumberList(props) { const numbers = props.numbers; const listItems = numbers.map((number) => <li>{number}</li> ); ...
🌐
W3Schools
w3schools.com › react › react_es6_array_map.asp
React ES6 Array map()
React Compiler React Quiz React Exercises React Syllabus React Study Plan React Server React Interview Prep ... The map() method creates a new array with the results of calling a function for every array element.
🌐
React-simple-maps
react-simple-maps.io › examples
React Simple Maps | Examples
Map chart showing a world map with tooltips using react-tooltip.
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › how-to-use-map-to-create-lists-in-reactjs
How to use map() to Create Lists in ReactJS ? - GeeksforGeeks
July 23, 2025 - Step 1: Create a React application ... ... It will look like the following. ... Example: This example uses the map function to render a lsit of fruits items stored as an array....
🌐
React-simple-maps
react-simple-maps.io
React Simple Maps
Create beautiful SVG maps in react with d3-geo and topojson using a declarative api. ... World mapchart showing Climate Watch CO2 emissions in metric tons per capita in 2020. See example.
🌐
Upmostly
upmostly.com › home › tutorials › how to use map() in react applications
How to use map() in React applications - Upmostly
March 11, 2022 - We have created the renderListOfUserNames function that maps over the provided array argument names and maps each name into HTML <li> tag. We are calling this function in the JSX and the result gets rendered to the page.
🌐
React
react.dev › learn › rendering-lists
Rendering Lists – React
You will often want to display multiple similar components from a collection of data. You can use the JavaScript array methods to manipulate an array of data. On this page, you’ll use filter() and map() with React to filter and transform your array of data into an array of components.
Find elsewhere
🌐
Medium
medium.com › @hammadrao891 › understanding-the-map-function-in-react-a-comprehensive-guide-887cee7f7955
Understanding the Map Function in React: A Comprehensive Guide | by Hammad Rao | Medium
December 14, 2023 - - Immutable Data: Avoid modifying the array you are mapping over. Instead, create a new array with the desired modifications. This is in line with React’s emphasis on immutability. ... The `map` function is versatile and can be used for conditional rendering as well. For example:
🌐
Javatpoint
javatpoint.com › react-map
React Map - Javatpoint
React Map - React Map with ReactJS Tutorial, ReactJS Introduction, ReactJS Features, ReactJS Installation, Pros and Cons of ReactJS, AngularJS vs ReactJS, Reactnative vs ReactJS, ReactJS Router, ReactJS Flux Concept, ReactJS Animations, ReactJS Discussion, ReactJS Quick Guide, etc.
🌐
GitHub
github.com › google-map-react › google-map-react
GitHub - google-map-react/google-map-react: Google map library for react that allows rendering components as markers :tada: · GitHub
It allows you to render any React component on the Google Map. It is fully isomorphic and can render on a server. Additionally, it can render map components in the browser even if the Google Maps API is not loaded.
Author: google-map-react
🌐
SheCodes
shecodes.io › athena › 7184-how-to-use-the-map-method-in-react
[React] - How to use the map method in React - SheCodes | SheCodes
Learn how to use the .map() method in React to iterate through an array and render a list of elements. Read this article for more information.
🌐
W3Schools
w3schools.com › react › react_es6_array_methods.asp
React ES6 Array Methods
The .map() method allows you to run a function on each item in the array, returning a new array as the result. In React, map() can be used to generate lists.
🌐
Medium
medium.com › react-digital-garden › react-map-examples-bef3f3849b32
React Map Examples. In this blog post, I will provide Map… | by Onur Dayıbaşı | Enterprise React Knowledge Maps | Medium
February 15, 2025 - Enterprise React React Map Examples In this blog post, I will provide Map examples from the EnterpriseReact website, as well as examples I made for various use cases. I discovered that I had created …
🌐
freeCodeCamp
freecodecamp.org › news › how-to-render-lists-in-react
How to Render Lists in React using array.map()
April 10, 2023 - In this tutorial, you will learn how to use this method to access array contents in React. We'll also explore how to pass a list of items into multiple React components using React props. The JavaScript map() method works by creating a new array that consists of outcomes from calling a function on the items in your array.
🌐
Scrimba
scrimba.com › articles › react-list-array-with-map-function
How to use Array.map to render a list of items in React
November 1, 2022 - You can see an example on CodePen. We can see here that the Array.map in the BookListcomponent iterates over the books array and then the Array.map in the Book component iterates over every element in the keywords property of every element in the books array. The Array.map method is a powerful higher-order function that lets you transform all the values in an array using a mapping function. This is especially useful for inserting a list of data into a React app, since you can't use for loops.
🌐
npm
npmjs.com › package › google-map-react
google-map-react - npm
May 23, 2025 - It allows you to render any React component on the Google Map. It is fully isomorphic and can render on a server. Additionally, it can render map components in the browser even if the Google Maps API is not loaded.
      » npm install google-map-react
    
Published: May 23, 2025
Version: 2.2.5
🌐
Hackingwithreact
hackingwithreact.com › read › 1 › 13 › rendering-an-array-of-data-with-map-and-jsx
Rendering an Array of Data with map() and JSX – a free Hacking with React tutorial
There's one more thing we're going ... enough React basics to be able to move on to a real project, and that's how to loop over an array to render its contents. Right now we have a single person with a single country, but wouldn't it be neat if we could have 10 people with 10 countries, and have them all rendered? Sure it would. Luckily for us, this is easy to do in JSX thanks to an array method called map(...