import React , { useEffect , useState , useCallback } from 'react' ; import "./SongList.scss" ; import loadable from "@loadable/component" ; const SongListHeader = loadable ( ( ) => import ( "./SongListHeader/SongListHeader" ) ) ; const SongListBody = loadable ( ( ) => import ( "./SongListBody/SongListBody" ) ) ; const SongList = ( ) => { const [ getName , setName ] = useState < string > ( "全部" ) ; const [ getHot , setHot ] = useState < string > ( "" ) ; const choicName = useCallback ( ( name , hot ? ) => { setName ( name ) ; setHot ( hot ! ) ; } , [ ] ) ; return ( < div className = "songListPage" > < div className = "songListBody" > { } < SongListHeader choicName = { choicName } / > < SongListBody name = { getName } getHot = { getHot } / > < /div> < /div>); } ; export default SongList ;