Skip to content

Instantly share code, notes, and snippets.

@oney
Created June 3, 2022 08:35
Show Gist options
  • Save oney/b539936d7244917064ecd1bd1fdc8af6 to your computer and use it in GitHub Desktop.
Save oney/b539936d7244917064ecd1bd1fdc8af6 to your computer and use it in GitHub Desktop.
import { Form } from 'antd';
// If 'submit' prop is useEvent-safe,
// antd would wrap withStable (from React.memo) internally
function Chat({onOdd, onEven}) {
const [text, setText] = useState('');
const onSubmit = () => {
sendMessage(text);
};
return <Form submit={onSubmit} />;
// 😚 I don't care!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment