Created
June 3, 2022 08:08
-
-
Save oney/a5f9ce66de9a14e083a0dd2b115999c3 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} | |
// 🙁 React.memo fails, and it'll re-render | |
/>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment