TypeScript

@types/react@18

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210
react 18去除了 props 中隐含的 children,造成了break changing

Removal of implicit children

For components that do implement children but relied on their implicit declaration from React.FunctionComponent or React.Component:

  1. interface Props {
  2. + children?: React.ReactNode;
  3. }
  4. class SomeClassComponents React.Component<Props> {
  5. render() {
  6. return <div>{this.props.children}</div>
  7. }
  8. }
  9. const SomeFunctionComponent: React.FunctionComponent<Props> = props => <div>{props.children}</div>

Please check Removal Of Implicit Children for the rationale.
I may have a solution to bring these back on-demand without patching the published types (watch #59751)
另外有这些类型被剔除,有的已有可替代类型

  1. -StatelessComponent
  2. +FunctionComponent
  3. -SFC
  4. +FC
  5. -React.ReactType
  6. +React.ElementType
  7. -SFCElement
  8. +FunctionComponentElement
  9. // no replacement
  10. -Props
  11. -RefForwardingComponent
  12. -SFCFactory

Tools

rome

prettier替代
https://rome.tools/blog/2022/04/05/rome_formatter_release

JavaScript

node:xxx

import { join } from 'node:path'引用地址增加 node 前缀

Debug

antd form

wecom-temp-773afaef1b7ed5364ce0ae495a72c0e8.png
该属性置为 false 后存在一个效果(副作用?),若当前表单域删除后再显示,表单域会使用 initialValue,猜测这才是这个api的真实用途?
所以存在一个情况,如果当前表单域在隐藏再显示的过程中更换了内部组件,肯定是不希望再使用原先的 intialValue 的,这就造成了异常。或 当前表单域已被修改,隐藏再显示后又为初始值,这样的效果实际也比较奇怪,所以该 api 设计比较奇怪,或只是不应该是这样的说明。