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

HOC issue GSAP target not found when trying to generate Timeline from props #26

Open
buzzguy opened this issue Jun 18, 2020 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@buzzguy
Copy link

buzzguy commented Jun 18, 2020

I'm trying to create multiple <Timeline /> components by mapping through an array of components that I'm trying to pass to target. Is there a way to dynamically build Timelines?

I am using it in conjunction with react-scrollmagic, but seeing the error with Timeline.

Here is my HOC:

const ScrollmagicWrapper = ({ children }) => {
  return (
    <Controller>
      <Scene reverse={true} triggerHook="onLeave" pin indicators={true}>
        {progress => (
          <Timeline totalProgress={progress} paused>
            {React.Children.map(children || null, (child, i) => {
              return (
                <Timeline target={<child.type {...child.props} key={i} />}>
                  <Tween
                    from={{ opacity: 0, y: '5%' }}
                    to={{ opacity: 1, y: '0' }}
                  />
                  <Tween to={{ opacity: 0 }} />
                </Timeline>
              );
            })}
          </Timeline>
        )}
      </Scene>
    </Controller>
  );
};

The error I'm getting is:
GSAP target not found

and when scrollmagic is trying to access Timeline
(ScrollMagic.Scene) -> ERROR: Element defined in option "triggerElement" was not found:

@bitworking bitworking added bug Something isn't working enhancement New feature or request labels Mar 31, 2021
@bitworking
Copy link
Owner

Not sure if fixed with 2.3.0. I would need a sandbox for testing.

@bitworking
Copy link
Owner

Could also be fixed with 3.1.0, because I optimized the target handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants