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

NodeJS support #155

Open
eliseumds opened this issue Sep 13, 2016 · 1 comment
Open

NodeJS support #155

eliseumds opened this issue Sep 13, 2016 · 1 comment

Comments

@eliseumds
Copy link

It would be great if Drop.js could also render on the server with React.js. Currently it cannot even be imported because document wouldn't be defined. That would require the initial document uses to be wrapped by something like if (typeof window !== 'undefined') { ... }.

@emjaksa
Copy link

emjaksa commented Sep 22, 2016

Use the require function to import tether drop in the componentDidMount function.

componentDidMount() {
  const Drop = require('tether-drop');
  this.dropInstance = new Drop({
    target: document.querySelector('.drop-target'),
    content: 'Welcome to the future',
    classes: 'drop-theme-arrows',
    position: 'bottom left',
    openOn: 'click'
  });
}

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