Skip to content

Instantly share code, notes, and snippets.

@oney
Created June 3, 2022 08:26
Show Gist options
  • Save oney/0dd067aecf58f5c496e82cef46c0f999 to your computer and use it in GitHub Desktop.
Save oney/0dd067aecf58f5c496e82cef46c0f999 to your computer and use it in GitHub Desktop.
function Chat({rooms}) {
const [text, setText] = useState('');
return rooms.map(room => (
<SendButton onClick={
() => sendMessage(room, text)
// 😚 No re-render and no wrapping
} />
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment