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

Position value never updated #32

Open
mvaivre opened this issue Apr 29, 2017 · 1 comment
Open

Position value never updated #32

mvaivre opened this issue Apr 29, 2017 · 1 comment

Comments

@mvaivre
Copy link

mvaivre commented Apr 29, 2017

I'm trying to setup a pretty simple examples to mess around with react-track, but I'm unable to get any value update for posTopTop. I've tried many different simple combinations, it never worked.

For instance, I have two div with height: 100vh;, stacked one over the other:

render() {
    return ( 
    <TrackDocument formulas={[topTop]} >
      {(topTop) =>
        <div>
          <Track component={Page1} formulas={[topTop]}>
            {(Page1Tracked,posTopTop) =>
              <Page1Tracked handleScrollToPage2={this._handleScroll} posTopTop={posTopTop} />
            }
          </Track>
          <Track component={Page2} formulas={[topTop]}>
            {(Page2Tracked,posTopTop) =>
              <Page2Tracked posTopTop={posTopTop} />
            }
          </Track>
        </div>
        }
      </TrackDocument>
    )
  }

When I console.log the posTopTopprops in Page1 and Page2 render(), I get the correct initial value when mounting, but if I scroll, this value doesn't change (the component gets new props and the console.log is executed, but the value stays the same).
Any idea about what's going on? Thanks...

@gilbox
Copy link
Owner

gilbox commented Apr 29, 2017

hmm strange, seems like it should work

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