added keys to looped items

This commit is contained in:
pepper 2021-01-19 19:55:07 -05:00
parent eec749c029
commit 5bafe0e1a2
2 changed files with 7 additions and 9 deletions

View File

@ -5,11 +5,11 @@ export function UList(props) {
<div> <div>
<ul> <ul>
{props.listItems.map((item) => ( {props.listItems.map((item) => (
<li liClass="white-text" className={props.liClass}> <li liclass="white-text" className={props.liclass} key={item}>
{item} {item}
</li> </li>
))} ))}
</ul> </ul>
</div> </div>
); );
} }

View File

@ -14,7 +14,6 @@ import ToolkitProvider, {
const CompTable = (props) => { const CompTable = (props) => {
const [list, setList] = useState([]); const [list, setList] = useState([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { SearchBar } = Search; const { SearchBar } = Search;
const { ExportCSVButton } = CSVExport; const { ExportCSVButton } = CSVExport;
const sizePerPageRenderer = ({ const sizePerPageRenderer = ({
@ -107,7 +106,6 @@ const CompTable = (props) => {
), ),
}, },
{ dataField: "booked_date", text: "Booked Date", sort: true }, { dataField: "booked_date", text: "Booked Date", sort: true },
// { dataField: "booked_time", text: "Booked Time", sort: true },
{ dataField: "agent_booked", text: "Agent initials", sort: true }, { dataField: "agent_booked", text: "Agent initials", sort: true },
{ {
dataField: "domain", dataField: "domain",
@ -120,9 +118,7 @@ const CompTable = (props) => {
{ dataField: "migration_type", text: "Type", sort: true }, { dataField: "migration_type", text: "Type", sort: true },
{ dataField: "original_server", text: "Original Server", sort: true }, { dataField: "original_server", text: "Original Server", sort: true },
{ dataField: "new_server", text: "New Server", sort: true }, { dataField: "new_server", text: "New Server", sort: true },
// { dataField: "term_date", text: "Termination Date", sort: true },
{ dataField: "notes", text: "Notes", sort: true }, { dataField: "notes", text: "Notes", sort: true },
// { dataField: "submit_time", text: "Submit Time", sort: true },
]; ];
useEffect(() => { useEffect(() => {
@ -130,7 +126,7 @@ const CompTable = (props) => {
}, []); }, []);
return ( return (
<div className="HistoricalSingle"> <div>
{loading ? ( {loading ? (
<ToolkitProvider <ToolkitProvider
keyField="name" keyField="name"
@ -138,12 +134,13 @@ const CompTable = (props) => {
columns={columns} columns={columns}
search search
exportCSV exportCSV
key={columns.id}
> >
{(props) => ( {(props) => (
<div> <div>
<div className="serSec"> <div className="serSec">
<h3 className="hdrOne"></h3> <h3 className="hdrOne"></h3>
<SearchBar {...props.searchProps} /> <SearchBar {...props.searchProps} key={columns} />
</div> </div>
<div className="table-responsive"> <div className="table-responsive">
@ -154,9 +151,10 @@ const CompTable = (props) => {
striped striped
hover hover
condensed condensed
key={columns.id}
/> />
</div> </div>
<ExportCSVButton {...props.csvProps}> <ExportCSVButton {...props.csvProps} key={columns}>
Export CSV!! Export CSV!!
</ExportCSVButton> </ExportCSVButton>
</div> </div>