mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
Merge pull request #348 from the-programmers-hangout/refact-clean-up-component-types
refact: clean up useless PropsWithChildren type
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { WindowLocation } from "@reach/router"
|
import { WindowLocation } from "@reach/router"
|
||||||
import React, { FC, PropsWithChildren, useMemo } from "react"
|
import React, { FC, useMemo } from "react"
|
||||||
|
|
||||||
function appendSlashToPath(path: string): string {
|
function appendSlashToPath(path: string): string {
|
||||||
return path.endsWith("/") ? path : `${path}/`
|
return path.endsWith("/") ? path : `${path}/`
|
||||||
@@ -26,9 +26,10 @@ export const LocationContext = React.createContext<ILocationContextInterface | n
|
|||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
|
||||||
export const LocationProvider: FC<PropsWithChildren<
|
export const LocationProvider: FC<ILocationProviderProps> = ({
|
||||||
ILocationProviderProps
|
children,
|
||||||
>> = ({ children, location }) => {
|
location,
|
||||||
|
}) => {
|
||||||
const memoizedContextValue = useMemo(
|
const memoizedContextValue = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
location,
|
location,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { FC, HTMLAttributes, PropsWithChildren } from "react"
|
import React, { FC, HTMLAttributes } from "react"
|
||||||
import Scrollbar from "react-perfect-scrollbar"
|
import Scrollbar from "react-perfect-scrollbar"
|
||||||
import "react-perfect-scrollbar/dist/css/styles.css"
|
import "react-perfect-scrollbar/dist/css/styles.css"
|
||||||
import cx from "classnames"
|
import cx from "classnames"
|
||||||
@@ -17,9 +17,7 @@ const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Sidebar: FC<PropsWithChildren<HTMLAttributes<HTMLDivElement>>> = (
|
export const Sidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
|
||||||
props
|
|
||||||
) => {
|
|
||||||
const { children, ...restProps } = props
|
const { children, ...restProps } = props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user