-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/CDP-185-LandingAnimation #55
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { UseInViewOptions, UseInViewResult } from "@/types/inView"; | ||
| import { useEffect, useRef, useState } from "react"; | ||
|
|
||
| export function useInView(options: UseInViewOptions = {}): UseInViewResult { | ||
| const { threshold = 0.2, rootMargin = "0px", once = true } = options; | ||
|
|
||
| const ref = useRef<HTMLDivElement | null>(null); | ||
| const [isInView, setIsInView] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broaden useInView ref type beyond HTMLDivElement
The hook currently creates ref with useRef<HTMLDivElement | null> and exposes that type. In this commit the hook is attached to <section> elements in LandingFeaturesSection1 and LandingFeaturesSection2, but under the repoβs strict TypeScript configuration a RefObject<HTMLDivElement> cannot be assigned to a section (RefObject<HTMLElement> is required). As a result the new components fail to compile. Consider widening the element type to HTMLElement or making the hook generic so it can be used with nonβdiv root elements.
Useful? React with πΒ / π.
π Pull Request
π PR μ ν
π λ³κ²½ μ¬ν
Fade-in & Bounce μ λλ©μ΄μ μΆκ°
Full page μ λλ©μ΄μ μΆκ°
πΈ μ€ν¬λ¦°μ·
π§ κ΄λ ¨ μ΄μ
π οΈ μ΅μ’ λ°°ν¬ μ κ² λ¦¬μ€νΈ
β μ΅μ’ λ°°ν¬ μ κ² κ²°κ³Ό