score:2
Accepted answer
you don't need to map through the array. all you need to do is put this.props.data
into the data
field.
data={this.props.data}
then, as long as the keys i.e firstname, lastname
etc... are in the objects, it shouldl print the table for you.
this is assuming your array looks like:
[{firstname: 'bob', lastname: 'sagget',...}, {firstname: 'george', lastname: 'bobbish',... }]
full return statement:
return(
<div>
<bootstraptable
hover
condensed={true}
bootstrap4={true}
keyfield='id'
data={this.props.data}
columns={columns}
/>
</div>
);
Source: stackoverflow.com
Related Query
- Table creating more table rather than a new row
- Insert more than one row material table
- if I have more than three cards, how can i create a new row for the 4th card in reactstrap or bootstrap?
- ReactJS: How do I add a new row to table from Form input values?
- How I can access the cancellation handler from creating a new row in material-table for reactJS?
- How to add each element in a list to a new row in React table
- How to hide a column on REACT Material table in all rows and show it on Edit for the Particular Row I am editing and Add Operations on new row adding?
- Router rendering the component on the same page rather than rendering in a new page
- react-beautiful-dnd - adding Lists in next row if more than 4 Lists exist
- React - move row of data to new table based on checkbox
- How do i access another column from related table other than the foreign key, when creating an API view
- Is it possible to make the new row that is generated by onRowAdd material table to appear at the top of the section?
- Ending then creating a table row in react
- how can i add new row my react bootstrap table
- Scroll table at top on adding a new row
- How to set new Sequence of the index while creating a new row in a table?
- Edit custom column component while adding new row of Material Table
- ReactJS Add new row to Table
- How to add new input row to table on click?
- Adding more than one row to an array inside componentDidMount for loop
- Adding values from inputs as new table row in ReactJS
- How to make table reload after users saves a new row to database
- how to remove duplicating data entry in a row when creating a table with reactjs
- Slider component with more than one row
- React table is not updating after new row added
- My else part of add to cart functionality is also putting the new quantity in the cartItems array rather than just increasing quantity of Items
- React Table is showing previous state rather than current state
- Table with with array of inputs duplicating row previous row when adding new row
- I am creating a table with a detaled row using React-Table and its hock useExpanded, but it doesn't working
- How can I edit the useEffect hook in react so that whenever there is a new row in mySQL or database, the table generated will auto refresh?
More Query from same tag
- It was set headers and axios but Why happen cros error?
- React Context with Hooks is always "one step behind"
- Socketio implementation with FastApi and React
- How to filter based on 3 different conditions (ReactJS)
- React JS : Logging the array items in the console
- How to enable prop-types in production for a React Storybook for the Docs addon
- storing value from text input into redux store cause re-rendering react component
- Implementing a Drawer & AppBar with Material-UI + React {Cannot read property 'open' of null}
- How to create a horizontal timeline in React
- componentDidUpdate isn't recognising state change
- Show counter onChange input box with a current defaultValue in React
- React.js Wierd behaviour
- How to sort a map by a specific field in es6 / React?
- How can I replace bits or string with React component, react-router-dom Link or an anchor tag <a></a>
- useEffect keeps fetching data and re-rendering the component
- How do I change MUI's select background color?
- How to pass an array of objects as a prop in react?
- Why is nodeJS returning different 'req.session'?
- How to use react-router
- React/Express - 'Unexpected token <' in call to renderToString()
- How to Pass Object Values to Children in ReactJS
- How to change the color of the primary Material UI
- How to Point webpack to take aseets from localhost:3000 ? currently its taking from the url
- Erratic and slow behavior with create-react-app and Skaffold kubernetes
- React Required Validation using State
- React Context API, updating context
- Map through an object with children objects- Javascript
- React Conditional Render and Navbar
- How to remove the start script error after executing 'npm start' for Reactjs App
- Error in console of AXIOS