0
votes

index.js:1 Warning: React.createElement: 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.

import React, { Component } from "react"; import ReactTable from "react-table";

export default class GetStatus extends Component {
  state = {
    data: [
      {
        tool_id: "One",
        status: "Up",
      },
      {
        tool_id: "Two",
        status: "Up",
      },
      {
        tool_id: "Three",
        status: "Up",
      },
      {
        tool_id: "Four",
        status: "Up",
      },
      {
        tool_id: "Five",
        status: "Up",
      },
    ],
    columns: [
      {
        Header: "Tool_ID",
        accessor: "tool_id",
      },
      {
        Header: "Status",
        accessor: "status",
      },
    ],
  };
  render() {
    return (
      <div>
        <ReactTable columns={this.state.columns} />
      </div>
    );
  }
}
1

1 Answers

0
votes

The message says "you might have mixed up default and named exports" that may be the reason. How did you import your GetStatus component?