Open TimKraemer opened 7 years ago
I tried to replicate the error but I wasn't able to install antd
(via npm install antd --save
but webpack complains about unresolved .js files).
So I simulated it (in TypeScript):
class Item extends React.Component<any,any> {
render() {
return <div>breadcrumb.item start {this.props.children} breadcrumb.item end</div>;
}
}
export class Breadcrumb extends React.Component<any,any> {
static Item = Item;
render() {
return <div>breadcrumb start {this.props.children} breadcrumb end</div>;
}
}
(this creates a Breadcrumb
component that has a subcomponent Item
as a static property).
Using your template it seem to work properly:
// this.state.breadcrumbs = [1,2,3,4];
breadcrumb start
breadcrumb.item start 1 breadcrumb.item end
breadcrumb.item start 2 breadcrumb.item end
breadcrumb.item start 3 breadcrumb.item end
breadcrumb.item start 4 breadcrumb.item end
breadcrumb end
Is there a quick way to install antd
so I can check it?
I tried to replicate the error but I wasn't able to install antd (via npm install antd --save but webpack complains about unresolved .js files).
I installed it the same way, no complains there. They have a way to import it in the browser. Maybe that will work? If not I'll look into creating a jsfiddle or github-repo to reproduce a minimal example of my problem.
Thank you for your dedication!
I wasn't able to install antd
(lot of troubles with react 15.4) so I opted for a CodePen example:
http://codepen.io/anon/pen/RKXpvM?editors=0010
I've taken the output directly from the react-templates playground and adapting it for the browser / codepen.
Hey there,
I'm playing around with react-templates and ant-design. Unfortunately using
rt-repeat
breaks my code:results in:
ReferenceError: Breadcrumb is not defined
. However withoutrt-repeat
it works fine:Using native HTML elements works as expected:
I suspect
rt-repeat
is somehow affecting the current variable scope, but I'm not involved enough to understand how and why.