小编gus*_*ani的帖子

如何使用带有自定义样式定义的 typescript 使用 react-select

我想知道如何使用 react-select 很好地向 Select 添加类型。

到目前为止的组件看起来像这样:

const Select: React.FC<Select> = (
  {defaultValue, onChange, options}: Select) => (
  <ReactSelect
    styles={selectStyles}
    …
  </ReactSelect>
Run Code Online (Sandbox Code Playgroud)

和的定义selectStyles

interface HoverProps {
  bowShadow: string
  border: string
}

interface ControlComponentCSSProperties extends CSSProperties {
  '&:hover': HoverProps
}

const selectStyles = {
  control: (
    provided: CSSProperties,
    state: Props<{label: string; value: string}> | Props<Record<string, unknown>>
  ): ControlComponentCSSProperties => ({
    ...provided,
    '&:hover': {
      bowShadow: 'none',
      border: 'none',
    },
    border: 'none',
    borderRadius: input.border.radius,
    borderBottomLeftRadius: state.menuIsOpen ? 0 : input.border.radius,
    borderBottomRightRadius: state.menuIsOpen …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs react-select

8
推荐指数
1
解决办法
3814
查看次数

如何从命令行打开两个文件,两个文件都在文件的末尾?

我想在vim中打开shell中的两个文件,并排放置,两个文件都滚动到文件的末尾.

截至目前我可以做到

vim -O "+ normal G $" file1 file2

除了将第二个文件滚动到最后,这样做我想要的一切.

非常感谢你

vim

1
推荐指数
1
解决办法
429
查看次数

标签 统计

react-select ×1

reactjs ×1

typescript ×1

vim ×1