yardz commented on a change in pull request #13220:
URL: https://github.com/apache/superset/pull/13220#discussion_r579519722
##########
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
> 1. Use named function instead of arrow functions, make it easier to find
in debugging code
I prefer arrow function because it is more performative and easier to read.
But in this case, it's just my taste. I can change this without any problems
> 2. Prefix props with component name, make it less likely to have export
conflicts
I put a prefix when the interface is exported. This is not the case for this
component/file. If someone in the future puts an export on the interface, they
need to change the name too.
----------------------------------------------------------------
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]