Uncaught Invariant Violation: Too many re-renders. React limits the number of renders to prevent an infinite loop

后端 未结 5 578
小鲜肉
小鲜肉 2020-12-08 18:29

I\'m trying to add a snackBar in order to display a message whenever a user signIn or not. SnackBar.jsx:

import React from \"react\";
import PropTypes from \         


        
5条回答
  •  悲&欢浪女
    2020-12-08 19:06

    You need to add an event, before call your handleFunction like this:

    function SingInContainer() {
    ..
    ..
    handleClose = () => {
    }
    
    return (
         handleClose}
            variant={variant}
            message={message}
            />
        
    )
    

    }

提交回复
热议问题