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
refactor(react-grid): replace render functions with components in Grid #486
Conversation
rootTemplate: PropTypes.func.isRequired, | ||
headerPlaceholderTemplate: PropTypes.func, | ||
footerPlaceholderTemplate: PropTypes.func, | ||
rootComponent: PropTypes.func.isRequired, |
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.
Is PropTypes.func
correct for this property?
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.
Yes. This is the way React components can be validated
…ctive into grid-tempates-to-components
@@ -29,25 +29,23 @@ Field | Type | Description | |||
name | string | Specifies the column name or the name of a row field whose value the column displays. If the column name does not match any field name, specify the `getCellValue` function. | |||
getCellValue | (row: any, columnName: string) => any | Specifies the function used to get the column value for a given row. | |||
|
|||
### <a name="root-args"></a>RootArgs | |||
### RootProps | |||
|
|||
Describes properties passed to the root template when it is being rendered. |
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.
'passed to the root template' -> 'passed to the root component' ? The same is in the HeaderPlaceholderProps
, FooterPlaceholderProps
BREAKING CHANGES:
The Grid's
rootTemplate
,headerPlaceholderTemplate
, andfooterPlaceholderTemplate
properties have been replaced withrootComponent
,headerPlaceholderComponent
, andfooterPlaceholderComponent
. This also means that they accept components instead of render functions. Find more details here: #496The
headerTemplate
,bodyTemplate
, andfooterTemplate
properties have been replaced with thechildren
property inrootTemplate
.