Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ES6 import the return is a function #103

Open
jonasantonelli opened this issue Aug 27, 2019 · 1 comment
Open

Using ES6 import the return is a function #103

jonasantonelli opened this issue Aug 27, 2019 · 1 comment

Comments

@jonasantonelli
Copy link

jonasantonelli commented Aug 27, 2019

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.

@cooljeffro
Copy link

Documentation needs to be updated. See #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants