mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #23940 from overleaf/td-react-18
Upgrade to React 18 GitOrigin-RevId: 9b81936e6eea2bccd97fe5c2c5841f0b946371b8
This commit is contained in:
@@ -176,7 +176,9 @@ export function useFileTreeData() {
|
||||
return context
|
||||
}
|
||||
|
||||
export const FileTreeDataProvider: FC = ({ children }) => {
|
||||
export const FileTreeDataProvider: FC<React.PropsWithChildren> = ({
|
||||
children,
|
||||
}) => {
|
||||
const [project] = useScopeValue<Project>('project')
|
||||
const [currentDocumentId] = useScopeValue('editor.open_doc_id')
|
||||
const [, setOpenDocName] = useScopeValueSetterOnly('editor.open_doc_name')
|
||||
@@ -227,14 +229,17 @@ export const FileTreeDataProvider: FC = ({ children }) => {
|
||||
})
|
||||
}, [rootFolder])
|
||||
|
||||
const dispatchCreateFolder = useCallback((parentFolderId, entity) => {
|
||||
entity.type = 'folder'
|
||||
dispatch({
|
||||
type: ACTION_TYPES.CREATE,
|
||||
parentFolderId,
|
||||
entity,
|
||||
})
|
||||
}, [])
|
||||
const dispatchCreateFolder = useCallback(
|
||||
(parentFolderId: string, entity: any) => {
|
||||
entity.type = 'folder'
|
||||
dispatch({
|
||||
type: ACTION_TYPES.CREATE,
|
||||
parentFolderId,
|
||||
entity,
|
||||
})
|
||||
},
|
||||
[]
|
||||
)
|
||||
|
||||
const dispatchCreateDoc = useCallback(
|
||||
(parentFolderId: string, entity: any) => {
|
||||
|
||||
Reference in New Issue
Block a user