-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Hello!
It seems that react-templates does not work with styled-components. I have the following error:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of MyComponent.
Here is my code :
component.js
import React, { Component } from 'react';
import P from './P';
import template from './index.rt.html';
export default class MyComponent extends Component {
render() {
return template();
}
};P.js
import styled from 'styled-components';
const P = styled.p`
color: red;
`;
export default P;index.rt.html
<rt-import name="P" from="./P" />
<P>blabla</P>Do you know what's wrong? Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels