Skip to content

How to use this with nextjs? #7

@krishnerkar

Description

@krishnerkar

I am not able to use this in nextjs, everytime i import it in a class and try to call it in componentDidMount(), the import throws an error called window not defined

and when i try dynamic importing like this

const grained = dynamic(
    () => {
      return import ('../../grained.min.js');
    },
    { ssr: false }
  );

and call it in componentdidmount like this

componentDidMount(){
        grained('#container', {});
    }

i get an error, cannot call a class as a function

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