Read Time20 Second
sumber : https://www.npmjs.com/package/react-device-detect
- Install react-device-detect pake npm
npm install react-device-detect --save
- import isMobilyOnly
import {isMobileOnly} from "react-device-detect";
- Isi componentnya
class App extends Component{
renderContent = () => {
if (isMobileOnly) {
return (
<div>Ini Isi Mobile, bisa di kasih route dll dll
</div>
)
}
return (
<div>Ini Isi desktop</div>
)
}
render() {return this.renderContent();}
}