Created
June 3, 2022 08:34
-
-
Save oney/b810ae9a1474f203e3ddd589a0f5cbe3 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({onOdd, onEven}) { | |
const [text, setText] = useState(''); | |
return <SendButton | |
onClick={text.length % 2 ? onEven : onOdd} | |
// 😚 SendButton won't re-render | |
/>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment