mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #7866 from overleaf/ae-createref
Replace createRef with useRef GitOrigin-RevId: c037806acaa917a5aa7a41a6f07747bd24410de7
This commit is contained in:
parent
12369b9f9a
commit
3ccd925d29
2 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
import { useEffect, createRef } from 'react'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import classNames from 'classnames'
|
||||
import scrollIntoViewIfNeeded from 'scroll-into-view-if-needed'
|
||||
|
@ -24,7 +24,7 @@ function FileTreeItemInner({ id, name, isSelected, icons }) {
|
|||
|
||||
const { isDragging, dragRef, setIsDraggable } = useDraggable(id)
|
||||
|
||||
const itemRef = createRef()
|
||||
const itemRef = useRef()
|
||||
|
||||
useEffect(() => {
|
||||
const item = itemRef.current
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useEffect, createRef, useRef } from 'react'
|
||||
import { useState, useEffect, useRef } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import scrollIntoViewIfNeeded from 'scroll-into-view-if-needed'
|
||||
import classNames from 'classnames'
|
||||
|
@ -18,7 +18,7 @@ function OutlineItem({ outlineItem, jumpToLine, highlightedLine }) {
|
|||
const { t } = useTranslation()
|
||||
|
||||
const [expanded, setExpanded] = useState(true)
|
||||
const titleElementRef = createRef()
|
||||
const titleElementRef = useRef()
|
||||
const isHighlightedRef = useRef(false)
|
||||
|
||||
const mainItemClasses = classNames('outline-item', {
|
||||
|
|
Loading…
Reference in a new issue