Skip to content

Instantly share code, notes, and snippets.

@ScriptedAlchemy
Last active November 25, 2019 00:49
Show Gist options
  • Save ScriptedAlchemy/6d1a761937a1055d86d5b9b8258ee140 to your computer and use it in GitHub Desktop.
Save ScriptedAlchemy/6d1a761937a1055d86d5b9b8258ee140 to your computer and use it in GitHub Desktop.
Interleaved magic export
// Menu.js
import React from 'react';
const Nav = ({items}) => {
return (<nav><ul>{items.map(Item=><Item/>)}</ul></nav>)
}
export const alert = (message) => {
alert(message)
}
export default Nav
// Marked with externalize comment, team intends for this file interface to be concumable by other applications
/*externalize:Nav*/
// App1.js
import Nav from './components/Menu' // needs to code split but was not import()'ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment