module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

React In Vue (converted to jsx) button event not firing

Open ronnyek opened this issue 4 years ago • 1 comments

This isn't so much a bug or anything... I'm assuming it's something I setup wrong etc... just curious if anyone had any clue as to what.

I changed the Button.js to Button.jsx and updated the contents to this:

function Button() {
    const buttonCLick = ()=>{
        console.log("Button Clicked!");
    }
    return (
        <button onClick={buttonCLick}>React Button</button>
    );
}
export default Button;

I updated the webpack configs so that this is actually rendered in the home project, and watching debug console, you can see the events fire when button is clicked.

Refreshing the layout site (port 3001) it renders the button just fine, but the button wiring simply doesnt work.

I suspect it something about how the component seems to be loaded from url, rendered to a string, and set to a variable... and then populated in the vue.

Is there a way I can wire up the components to have some basic functionality, and expect the vue host to be able to trigger those events?

ronnyek avatar Jun 03 '21 15:06 ronnyek

Not sure. It should work

ScriptedAlchemy avatar Jul 03 '21 01:07 ScriptedAlchemy