mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 07:56:11 +02:00
refact: convert components to use React.FC type + type improvements
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
d61c218657
commit
1d88367645
@@ -1,8 +1,4 @@
|
||||
import React, { useMemo, useState } from "react"
|
||||
|
||||
interface ISidebarProviderProps {
|
||||
children: React.ReactNode
|
||||
}
|
||||
import React, { FC, useMemo, useState } from "react"
|
||||
|
||||
export interface ISidebarContextInterface {
|
||||
current: number
|
||||
@@ -13,7 +9,7 @@ export const SidebarContext = React.createContext<ISidebarContextInterface | nul
|
||||
null
|
||||
)
|
||||
|
||||
export function SidebarProvider({ children }: ISidebarProviderProps) {
|
||||
export const SidebarProvider: FC = ({ children }) => {
|
||||
const [current, setCurrent] = useState(0)
|
||||
|
||||
const memoizedContextValue = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user