小编Łuk*_*ski的帖子

Gatsby not loading useEffect function in production

I'm creating a website using Gatsby.js. In my component, I'd created animation using Gsap, inside useEffect function.

While debugging, all works. In production the useEffect function not running, what follows to not showing animations.

What I should do? Any ideas?

Thanks for answers!

My component:

import React, { useRef, useEffect } from "react"
import styled from "styled-components"
import gsap from "gsap"
import WhatEver from "../../../static/whatever.svg"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faArrowDown } from '@fortawesome/free-solid-svg-icons'
import scrollTo from …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs gsap gatsby

6
推荐指数
1
解决办法
1169
查看次数

标签 统计

gatsby ×1

gsap ×1

javascript ×1

reactjs ×1