ktmud commented on a change in pull request #13220:
URL: https://github.com/apache/superset/pull/13220#discussion_r580542997
##########
File path: superset-frontend/src/components/FlashProvider/index.tsx
##########
@@ -37,21 +36,19 @@ const flashObj = {
success: 'addSuccessToast',
};
-class FlashProvider extends React.PureComponent<Props> {
- componentDidMount() {
- const flashMessages = this.props.common.flash_messages;
- flashMessages.forEach(message => {
+const FlashProvider: React.FC<Props> = ({ children, messages }) => {
Review comment:
@nytai Indeed, JSX will add `name` to components created by arrow
functions. My comments were based on past experience pre-React world.
Re: the automatically added `children` prob. I'm not sure how useful is
this. A component either needs or not need the component prob. If it does not
handle `children`, then `children` should not be an accepted prop; if it does,
then it makes sense to be more explicit.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]