Skip to content

Position value never updated #32

Description

@mvaivre

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...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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