kaimallea/isMobile

Using ES6 import the return is a function

jonasantonelli opened this issue · 1 comments

Using ES6 import is needed to run as a function to work.

Ex:

import React from 'react';
import isMobile from 'ismobilejs';

const Navbar = () => {
  const navbarColllapseTarget = isMobile().phone ? '#nav-search-user' : '';
  return (...);
}

export default Navbar;

This works: isMobile().phone
This does not: isMobile.phone

In documentation is specified to use isMobile as an Object. In a previous project, I used as an Object.

Maybe I'm doing something wrong, I don't know.

Documentation needs to be updated. See #97