Skip to content
Discussion options

You must be logged in to vote

this is the cause

export default function HomePlane1({ snapping, hover_dist, i, timerx, hovering, mouse }: Type): JSX.Element {
  const HomePlane = (props) => {
  ...
  }
  return <HomePlane ... />

you can't define components in components. the inner component does not have life cycles, gets unmounted/remounted every render. you don't need the HomePlane1 wrap at all.

ps 90% of that code can be thrown away. you don't need event handlers, all of that is taken care of (state.mouse.x/y). the function you call to animate creates hell for the garbage collector by making up further functions every frame. every where i see is functions in functions, but why ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Iambizi
Comment options

Answer selected by Iambizi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants