fixed error on local environment
This commit is contained in:
@@ -5,6 +5,8 @@ import links from "../constants/page-links"
|
|||||||
import gsap from "gsap"
|
import gsap from "gsap"
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import { Link } from "gatsby"
|
import { Link } from "gatsby"
|
||||||
|
import { act } from 'react-dom/test-utils'
|
||||||
|
|
||||||
|
|
||||||
const Header = props => {
|
const Header = props => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
@@ -13,10 +15,11 @@ const Header = props => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const { stargazers_count, forks_count } = response.data
|
const { stargazers_count, forks_count } = response.data
|
||||||
|
act(() => {
|
||||||
setstats({
|
setstats({
|
||||||
starsCount: stargazers_count,
|
starsCount: stargazers_count,
|
||||||
forksCount: forks_count,
|
forksCount: forks_count,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user