patchesStrategicMerge我在 kustomization.yaml 文件中看到,但没有清楚地了解它,比如它的需要是什么或者我们为什么需要它?
自定义.yaml
resources:
- a.yaml
patchesStrategicMerge:
- b.yaml
- c.yaml
Run Code Online (Sandbox Code Playgroud)
我经历过这个: https: //kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/#customizing和 https://github.com/kubernetes/community/blob/master/contributors/devel/sig- api-machinery/strategic-merge-patch.md
我有 index.html
<body>
<div id="portal"></div>
<div id="root"></div>
</body>
Run Code Online (Sandbox Code Playgroud)
并希望使用低于单独的组件portal div比root div,
import React from 'react';
const portalDiv = document.getElementById('portal');
function Portal1(props) {
return ReactDOM.createPortal(
<div>
{props.children}
<div/>,
portalDiv); //here
}
export default Portal1;
Run Code Online (Sandbox Code Playgroud)
但我收到此错误,类型为“HTMLElement |的参数” null' 不可分配给类型为 'Element' 的参数。类型 'null'在 VScode 中不能分配给类型 'Element'.ts(2345)。
我正在使用打字稿。请帮忙。