I am trying to add a very basic implementation of the Office UI Fabric's DetailsList React component to my project, but keep on getting the following error when trying to render it: 'DetailsColumn.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.'
Below follows the code sample I'm trying to implement. I tried to make it as simple as possible so I have a starting point I could upgrade on, but seem unable to figure out what's missing. Any ideas?
import {
DetailsList,
IColumn,
SelectionMode
} from 'office-ui-fabric-react';
export class TableView extends React.Component< ITableViewProps, ITableViewState> {
constructor(props: ITableViewProps) {
super(props);
}
public render(): JSX.Element {
const columns: IColumn[] = [
{
key: 'Title',
name: 'Title',
fieldName: 'title',
minWidth: 50
}
];
let test: any[] = [{Title: "TestTitle"}];
return (
<DetailsList items={test} columns={columns} />
);
};
}
public render(): React.ReactElement<ITableViewProps>
and checking ?