Skip to content

Instantly share code, notes, and snippets.

@oshell
Created March 19, 2020 17:31
Show Gist options
  • Save oshell/27b5fcc2d613761bd515ca5c0a67f3a4 to your computer and use it in GitHub Desktop.
Save oshell/27b5fcc2d613761bd515ca5c0a67f3a4 to your computer and use it in GitHub Desktop.
Reactn Function Component
import React, { useGlobal } from 'reactn'; // <-- reactn
import Card from '../card/card';
const Cards = () => {
const [cards, setCards] = useGlobal('cards');
return (
<div>
{cards.map(card => (
<Card key={card.id} {...card} />
))}
</div>
);
};
export default Cards;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment