Move GraphComponentState type into tslib/react

This commit is contained in:
porink0424
2024-06-14 15:56:51 +09:00
parent 4725e256c9
commit 29a861f496
6 changed files with 10 additions and 9 deletions
+1
View File
@@ -10,6 +10,7 @@ lerna-debug.log*
node_modules
pkg
types
!src/types
# Editor directories and files
.vscode/*
@@ -1,10 +1,10 @@
import { Box, Typography, useTheme } from "@mui/material"
import * as Optuna from "@optuna/types"
import { FC } from "react"
import { GraphComponentState } from "../types"
export const GraphContainer: FC<{
plotDomId: string
graphComponentState: Optuna.GraphComponentState
graphComponentState: GraphComponentState
}> = ({ plotDomId, graphComponentState }) => {
const theme = useTheme()
return (
@@ -1,9 +1,9 @@
import * as Optuna from "@optuna/types"
import { useEffect, useState } from "react"
import { GraphComponentState } from "../types"
export const useGraphComponentState = () => {
const [graphComponentState, setGraphComponentState] =
useState<Optuna.GraphComponentState>("componentWillMount")
useState<GraphComponentState>("componentWillMount")
useEffect(() => {
setGraphComponentState("componentDidMount")
}, [])
+1
View File
@@ -17,3 +17,4 @@ export {
useObjectiveAndUserAttrTargets,
useObjectiveAndUserAttrTargetsFromStudies,
} from "./utils/trialFilter"
export type { GraphComponentState } from "./types"
+4
View File
@@ -0,0 +1,4 @@
export type GraphComponentState =
| "componentWillMount"
| "componentDidMount"
| "graphDidRender"
-5
View File
@@ -93,8 +93,3 @@ export type ParamImportance = {
name: string
importance: number
}
export type GraphComponentState =
| "componentWillMount"
| "componentDidMount"
| "graphDidRender"