Skip to content

[TypeScript] I don't really understand how I implement this. #96

@JohnyTheCarrot

Description

@JohnyTheCarrot

Trouble With Implementation

Hi everyone, I'm so sorry if I missed something obvious, but I can't seem to figure out how to implement this library, and it's just been an overall headache to figure out. I've spent quite a while looking at the docs and example code but can't seem to get a working version. Help would be greatly appreciated! Again, sorry if I had missed something somewhere.

image

type ParallaxHomePageProps = {
  parallaxController: {
    update: () => void;
    destroy: () => void;
  };
};

type ParallaxHomePageState = {};

export class ParallaxHomePage extends React.Component<
  ParallaxHomePageProps,
  ParallaxHomePageState
> {
  constructor(props: ParallaxHomePageProps) {
    super(props);
    this.state = {};
  }

  render() {
    return (
      <ParallaxProvider>
        <div style={{ height: "100%", overflow: "auto", display: "flex" }}>
          <div style={{ position: "relative" }} className="full-width"> // full-width = fill remaining width
            <Parallax className="custom-class" x={[-20, 20]}>
              <h1>AAAAAAAAAAAAAAA</h1>
            </Parallax>
            <Parallax className="custom-class" x={[-20, 20]}>
              <h1>AAAAAAAAAAAAAAA</h1>
            </Parallax>
            <Parallax className="custom-class" x={[-20, 20]}>
              <h1>AAAAAAAAAAAAAAA</h1>
            </Parallax>
          </div>
        </div>
      </ParallaxProvider>
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions