react-web-component
react-web-component copied to clipboard
TypeError: Cannot read property 'create' of undefined
Error in Chrome trying to create a web-component with react and typescript
index.tsx:5 Uncaught TypeError: Cannot read property 'create' of undefined
at Object.
i built a simple component:
import * as React from 'react';
export const HeaderComponent = () => {
return <div>Header Component</div>;
};
and a index.tsx
import * as React from 'react';
import ReactWebComponent from 'react-web-component';
import { HeaderComponent } from './headercomponent';
ReactWebComponent.create(<HeaderComponent />, 'header-component');
i built it with webpack and the awesome-typescript-loader
this is my html file
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<script src="header-component.min.js"></script>
</head>
<body>
<header-component></header-component>
</body>
</html>
Is there Support for Typescript available?
Did you find a solution to this in the end? I'm having the same issue.
Same here
I'm having the same problem