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

component loading logging and intersection-observer hook #13

Open
j67Sv89n opened this issue Mar 11, 2023 · 0 comments
Open

component loading logging and intersection-observer hook #13

j67Sv89n opened this issue Mar 11, 2023 · 0 comments

Comments

@j67Sv89n
Copy link

I have a question about component loading logging.
My test scene have simple route and few components:

<NavBar />    (have 3 componets -wrap, -firstline, secondline, thirdline)
      <Router>
            <Home path="/" />     (have 3 componets -advertise - news -intersect)
     </Router>
+++++++++++++
Component Home:
<Advertise />
<News />
 <Intersect options={{ triggerOnce: true, threshold: 0.0 }}>
           <Suspense fallback={""}>
                     <h1>My Intersection String</h1>
                     {console.log("Component for Intersection")}
            </Suspense>
</Intersect>
  +++++++++++++

My log with all suspense import in home component:
navBar - Wrap
Component for Intersection
ref {current: undefined}
inView false
Intersect Wrap
navBar - FirstLine
ref {current: div}
inView true
Intersect Wrap
navBar - SecondLine
navBar - ThirdLine
Advertise - Component
News - Component

My log with one suspense import for Intersect component, other Advertise and News without suspense import:
navBar - Wrap
Component for Intersection
Advertise - Component
News - Component
ref {current: undefined}
inView false
Intersect Wrap
navBar - FirstLine
navBar - SecondLine
navBar - ThirdLine

Why in that case I see always first load intersect hook? it's because of useEffect in observer hook ?
My Intersect wrap have default export, how as a separate component.

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

1 participant