Open skipjack opened 6 years ago
I think I finally figured out a nice way to solve this. We can write a Babel plugin that can inject Interactive
with the correct id (path). Then you would simply do <VoteApp />
and the plugin would detect when to wrap (based on state
and/or handlers).
Importing a component directly from an npm package, and using it as an
interactive
component with an ID of the same path throws build errors. For example:I did find a workaround by specifying the full relative path:
Admittedly, this probably won't happen too often so if it's a complex or hacky fix maybe a better approach is just to document the workaround.