Skip to content

Instantly share code, notes, and snippets.

@codewithbernard
Created November 26, 2021 11:34
Show Gist options
  • Select an option

  • Save codewithbernard/be4e19cc17855b642b09e7cbb320b42f to your computer and use it in GitHub Desktop.

Select an option

Save codewithbernard/be4e19cc17855b642b09e7cbb320b42f to your computer and use it in GitHub Desktop.
import React from "react";
import { connect } from "react-redux";
const Users = ({ users }) => {
return (
<ul>
{users.map((user) => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
};
const mapState = ({ users }) => ({
users,
});
export default connect(mapState)(Users);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment