Skip to content

Instantly share code, notes, and snippets.

@luistak
Created January 27, 2021 15:47
Show Gist options
  • Save luistak/2f25a86b14beb105a4fcfd84d878c980 to your computer and use it in GitHub Desktop.
Save luistak/2f25a86b14beb105a4fcfd84d878c980 to your computer and use it in GitHub Desktop.
const { worky } = window;
function App() {
const handleSubmit = (e) => {
e.preventDefault();
const { target: form } = e;
const input = form?.elements?.something;
worky.say(input.value);
form.reset();
}
return (
<div className="MF">
<h3>Microfrontend 2️⃣</h3>
<p>⌨️ Use this form to communicate with the other microfrontend</p>
<form onSubmit={handleSubmit}>
<input type="text" name="something" placeholder="Type something in here"/>
<button type="submit">Communicate!</button>
</form>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment