1
Hello, I wanted to import a webpack generated React external component (Bundle.js) into my Asp.net MVC application. I am trying to import the "Bundle.js" file to my page and process the React component in the Babel script tag, but nothing happens. What is the correct way to import an external component from a webpack library into a View?
Here’s an example of how I’m doing, "Customtextbox" is the component I want to use that’s inside Bundle.js:
<script src="~/Scripts/bundle.js"></script>
<script type="text/babel">
ReactDOM.render(
<CustomTextbox />,
document.getElementById('timer')
);
</script>
Put this script
ReactDOM.render(
inside the component for the webpack to pack everything. Otherwise you have to export Reactdom to global space and the components that are in that `Bundle.js``– Sergio