Blank lines in the datagrid component of Materialui

Asked

Viewed 20 times

0

I have a problem, I am using the Material UI Datagrid component and every time I make a request and return me the data, new blank lines are also created, there is some way to change this component behavior?. Below my code.

Code where I mount the datagrid

function OccupationTable(props){
const coluns = [
    {field: "id", headerName:"Código",width: 150},
    {field: "name",headerName: "Nome",width: 250}
];
return (
    <React.Fragment>
        <div className="row mt-2">
            <div className="col-md-12">
                <div className="card me-2 ms-2">
                    <div className="card-header">
                        <strong>Funções</strong>
                    </div>

                    <div className="card-body">
                        <div className="row">
                            <div className="col-md-12">
                                 <DataGrid
                                    columns={coluns}
                                    rows={props.data}
                                    autoHeight={true}
                                    pageSize={5}
                                />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </React.Fragment>
)

} export default Occupationtable;

Code where I call the component

 const {occupations} = useSelector(state => state.estadoOccupation);
return(
    <React.Fragment>
        <Header/>
        <SearchOccupation/>
        {(occupations.data.length > 0) && <OccupationTable data={occupations.data}/>}
    </React.Fragment>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.