Created
June 3, 2022 08:26
-
-
Save oney/0dd067aecf58f5c496e82cef46c0f999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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