import React from "react" ; import CleanUpCaseHook from "../../Components/Hooks/EffectHook/clienUpCaseHook" ; import CleanUpCaseClass from "../../Components/Hooks/EffectHook/cleanUpCaseClass" ; import ErrorBoundary from "../ErrorBoundary/ErrorBoundary" ; const About = React . lazy ( ( ) => import ( "./About/About" ) ) ; const Home = React . lazy ( ( ) => import ( "./Home/Home" ) ) ; const Inquire = React . lazy ( ( ) => import ( "./Inquire/Inquire" ) ) ; const Splitting = ( ) => { const [ router , setRouter ] = React . useState ( "Home" ) ; const makeContainer = React . useCallback ( ( ) => { switch ( router ) { case "Home" : return < Home />; case "About" : return < About />; case "Inquire" : return < Inquire />; default : return < Home />; } } , [ router ] ) ; return ( < div style = { { padding : 16 } } > { } { } < CleanUpCaseClass /> < /div>); } ; export default Splitting ;