i have a text.tsx
interface Props{
...
}
interface State{
...
}
class Test extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {name: 'Joe'} ;
}
render() {
const { name } = this.state;
return (
<div>
It is {name}
</div>
);
}
}
export default Test;
and a test-widget.tsx
import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget';
import React from 'react';
import Test from '../components/Test';
export class TestWidget extends ReactWidget {
constructor(
) {
super();
this.id = TEST_WIDGET_ID;
this.title.label = 'Test';
this.title.caption = 'Test';
this.title.closable = true;
this.title.iconClass = 'fa test-tab-icon';
this.addClass('container');
}
protected render(): React.ReactNode {
return <Test />;
}
}
but nothing gets displayed, i don’t get any errors in console or in lint . has anyone tried it before?
[original thread by Nitika Sharma]