Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Antwar Interactive ID Resolving Bug #134

Open
skipjack opened this issue Dec 22, 2017 · 1 comment
Open

Antwar Interactive ID Resolving Bug #134

skipjack opened this issue Dec 22, 2017 · 1 comment

Comments

@skipjack
Copy link

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:

import VoteApp from 'webpack.vote'

// ...
<Interactive
     id="webpack.vote" // or "webpack.vote/dist/vote.bundle.js"
     component={ VoteApp } />

I did find a workaround by specifying the full relative path:

id="./node_modules/webpack.vote"

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.

@bebraw
Copy link
Member

bebraw commented Feb 15, 2018

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants