Last active
November 25, 2019 00:49
-
-
Save ScriptedAlchemy/6d1a761937a1055d86d5b9b8258ee140 to your computer and use it in GitHub Desktop.
Interleaved magic export
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
// 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