上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 494 下一页
摘要: import React from "react"; import { Equal, Expect } from "../helpers/type-utils"; const createRequiredContext = <T extends any>() => { const context = 阅读全文
posted @ 2023-08-16 20:20 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: // Problem import { useState } from "react"; import { Equal, Expect } from "../helpers/type-utils"; export const useId = (defaultId: string) => { cons 阅读全文
posted @ 2023-08-16 19:48 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要: In package management systems like npm (for JavaScript/Node.js projects), dependencies are typically fetched from a remote registry. However, there ar 阅读全文
posted @ 2023-08-16 15:40 Zhentiw 阅读(19) 评论(0) 推荐(0)
摘要: Typescript has its problem that when you try to compare generic function to a function signature, you will run into issue. Because for one function, i 阅读全文
posted @ 2023-08-16 02:48 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: import { Equal, Expect } from "../helpers/type-utils"; interface Button<T> { value: T; label: string; } interface ButtonGroupProps<T> { buttons: Butto 阅读全文
posted @ 2023-08-12 16:49 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要: import { ReactNode } from "react"; import { Equal, Expect } from "../helpers/type-utils"; interface TableProps<T> { rows: T[]; renderRow: (row: T) => 阅读全文
posted @ 2023-08-12 16:19 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: interface TableProps<T> { rows: T[]; renderRow: (row: T) => ReactNode; } export class Table<T> extends React.Component<TableProps<T>> { render(): Reac 阅读全文
posted @ 2023-08-12 16:08 Zhentiw 阅读(13) 评论(0) 推荐(0)
摘要: export const Table = <T>(props: TableProps<T>) => { return ( <table> <tbody> {props.rows.map((row) => ( <tr>{props.renderRow(row)}</tr> ))} </tbody> < 阅读全文
posted @ 2023-08-11 15:01 Zhentiw 阅读(17) 评论(0) 推荐(0)
摘要: Go ahead and install the Remote - Containers extension. This takes everything one step further: you can actually set up someone's editor for them when 阅读全文
posted @ 2023-08-09 14:36 Zhentiw 阅读(91) 评论(0) 推荐(0)
摘要: import { ComponentProps } from "react"; import { Equal, Expect } from "../helpers/type-utils"; const buttonProps = { type: "button", // @ts-expect-err 阅读全文
posted @ 2023-08-07 15:02 Zhentiw 阅读(22) 评论(0) 推荐(0)
上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 494 下一页