nytai commented on a change in pull request #13220:
URL: https://github.com/apache/superset/pull/13220#discussion_r580511093



##########
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:
       @ktmud this is only true for anonymous default exports. In the case of 
`const CoolComponent: React.FC<Props> = props => ...` react is able to add the 
component name to stack traces based on the variable name, this also allows for 
the use of the `React.FC` interface which adds the `children` prop. 




----------------------------------------------------------------
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]

Reply via email to