-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added header #20
base: master
Are you sure you want to change the base?
added header #20
Conversation
SoldatovMikhaul
commented
Jun 16, 2021
|
||
export default function DataGridDemo() { | ||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection /> | ||
<DataGrid rows={getRooms()} columns={columns} pageSize={5} checkboxSelection /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<DataGrid rows={getRooms()} columns={columns} pageSize={5} checkboxSelection /> | |
<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно пожалуйста текстовое пояснение проблемы я не очень понял что не так у меня
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SoldatovMikhaul у тебя выше на 23-ей строке уже есть переменная rows
{ id: 6, roomNumber: 'A202' }, | ||
{ id: 7, roomNumber: 'A107' }, | ||
]; | ||
const rows = getRooms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const rows = getRooms | |
const rows = getRooms() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вообще тащите в UseEffects
@@ -1,4 +1,5 @@ | |||
import * as React from 'react'; | |||
import { getRooms } from "./TeacherService" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Опусти на строчку ниже
{ id: 7, roomNumber: 'A107' }, | ||
]; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавь пустую строку в конце файла
export const getRooms = () => { | ||
return [ | ||
{ id: 1, roomNumber: 'A100' }, | ||
{ id: 2, roomNumber: 'A102' }, | ||
{ id: 3, roomNumber: 'A103' }, | ||
{ id: 4, roomNumber: 'A201' }, | ||
{ id: 5, roomNumber: 'A310' }, | ||
{ id: 6, roomNumber: 'A202' }, | ||
{ id: 7, roomNumber: 'A107' }, | ||
]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
отформатируй код, убери лишний return и добавь тип возвращаемого значения
export const getRooms = () => { | |
return [ | |
{ id: 1, roomNumber: 'A100' }, | |
{ id: 2, roomNumber: 'A102' }, | |
{ id: 3, roomNumber: 'A103' }, | |
{ id: 4, roomNumber: 'A201' }, | |
{ id: 5, roomNumber: 'A310' }, | |
{ id: 6, roomNumber: 'A202' }, | |
{ id: 7, roomNumber: 'A107' }, | |
]; | |
} | |
export const getRooms = () => [ | |
{ id: 1, roomNumber: 'A100' }, | |
{ id: 2, roomNumber: 'A102' }, | |
{ id: 3, roomNumber: 'A103' }, | |
{ id: 4, roomNumber: 'A201' }, | |
{ id: 5, roomNumber: 'A310' }, | |
{ id: 6, roomNumber: 'A202' }, | |
{ id: 7, roomNumber: 'A107' }, | |
]; |
}), | ||
); | ||
|
||
export default function ButtonAppBar() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Твой текущий файл называется Header.tsx
а компонент внутри ButtonAppBar
, имя компонента должно совпадать с именем файла
export default function ButtonAppBar() { | |
export default function Header() { |
|
||
export default function DataGridDemo() { | ||
return ( | ||
<div style={{ height: 400, width: '100%' }}> | ||
<DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection /> | ||
<DataGrid rows={getRooms()} columns={columns} pageSize={5} checkboxSelection /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SoldatovMikhaul у тебя выше на 23-ей строке уже есть переменная rows
@SoldatovMikhaul Есть ли исправления по MR ? |