8000 Using ES6 import the return is a function · Issue #103 · kaimallea/isMobile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Using ES6 import the return is a function #103
Open
@jonasantonelli

Description

@jonasantonelli

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;

T 4EDD his 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0