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

how to use with reactjs #82

Open
gmchaturvedi1 opened this issue Nov 22, 2016 · 3 comments
Open

how to use with reactjs #82

gmchaturvedi1 opened this issue Nov 22, 2016 · 3 comments

Comments

@gmchaturvedi1
Copy link

can u please guide me how to use this with reacrtjs

@joekrie
Copy link

joekrie commented Dec 22, 2016

Can you provide details on your build setup (e.g., webpack, SystemJS, Babel CLI, etc)?

@cdtinney
Copy link

cdtinney commented May 1, 2017

I'm also looking for the 'right' way to do this.

I'm using Webpack with Babel and SCSS.

I tried importing the module, and calling walk as per #57 but was receiving an error about walk not being defined unless I called init beforehand.

Should init be called on each component, or shouldflexibility just be imported and init'ed on the root component?

@lachiet
Copy link

lachiet commented Oct 3, 2017

flexibility.init was undefined for me because the js is minified when installing via npm but managed to get this working by doing the following...

Call the function on the root component:

componentDidMount() {
    flexibility(document.body).
}

If using react-router you'll need to call this function every time you change page:

update() {
    flexibility(document.body);
}

// somewhere in render function
<Router history={browserHistory} onUpdate={this.update}>

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

4 participants