diff --git a/src/components/hooks/useCycle/index.jsx b/src/components/hooks/useCycle/index.jsx index 6bf48772..16022db8 100644 --- a/src/components/hooks/useCycle/index.jsx +++ b/src/components/hooks/useCycle/index.jsx @@ -1,7 +1,7 @@ -import React from 'react' +import React, { useState } from 'react' const useCycle = (options = [], defaultValue = '') => { - const [index, setIndex] = React.useState(defaultValue ? undefined : 0) + const [index, setIndex] = useState(defaultValue ? undefined : 0) const next = () => setIndex((i) => ((i ?? -1) + 1) % options.length) return [index == null && defaultValue ? defaultValue : options[index ?? 0], next] diff --git a/src/components/hooks/useRootClick/index.jsx b/src/components/hooks/useRootClick/index.jsx index fa20b831..d74ee56d 100644 --- a/src/components/hooks/useRootClick/index.jsx +++ b/src/components/hooks/useRootClick/index.jsx @@ -1,7 +1,7 @@ -import React from 'react' +import React, { useEffect } from 'react' const useRootClick = (cb = () => {}) => { - React.useEffect(() => { + useEffect(() => { const controller = new AbortController() document.documentElement.addEventListener( 'click',