I want to refer to the variable in function component, I think normally I use this to refer to local variable.
However in function component,I can't use this.
Maybe, I am still confused by function component though...
export default function TrackPage(props) { const classes = useStyles(); useEffect(() => { var playlist = 1; } function handleToolBarClick(){ this.playlist // this is empty. } } https://stackoverflow.com/questions/65948626/refering-local-valiable-without-this-in-function-component January 29, 2021 at 12:05PM
没有评论:
发表评论