Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you install npm install react-useragent
import React from 'react';
import withUserAgent from 'react-useragent';
class App extends React.Component {
render() {
return (
<div>
{this.props.ua.mobile ? (
"mobile"
) : (
"something else"
)}
</div>
);
}
}
export default withUserAgent(App);
The most helpful REACT solutions
How to get client ip address using react ?REACT Click to see more ... 19.2K 421