
获得徽章 0
ModuleFederationPlugin 模块共享中的singleton
This hint only allows a single version of the shared module in the shared scope (disabled by default). Some libraries use a global internal state (e.g. react, react-dom). Thus, it is critical to have only one instance of the library running at a time.
这个提示允许在共享范围内中的共享模块的单个版本(默认情况下禁用), 有些库使用全局内部状态(如 react、 react-dom), 因此, 一次运行一个库实例是至关重要的。
太难了 翻完一知半解了![[泣不成声]](//lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_40.348108b.png)
![[泣不成声]](//lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_40.348108b.png)
This hint only allows a single version of the shared module in the shared scope (disabled by default). Some libraries use a global internal state (e.g. react, react-dom). Thus, it is critical to have only one instance of the library running at a time.
这个提示允许在共享范围内中的共享模块的单个版本(默认情况下禁用), 有些库使用全局内部状态(如 react、 react-dom), 因此, 一次运行一个库实例是至关重要的。
太难了 翻完一知半解了
![[泣不成声]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_40.348108b.png)
![[泣不成声]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_40.348108b.png)
![[泣不成声]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_40.348108b.png)
展开
评论
点赞
程序员周末英语
Usually, you will pass information from a parent component to a child component via props. But passing props can become verbose and inconvenient if you have to pass them through many components in the middle, or if many components in your app need the same information. Context lets the parent component make some information available to any component in the tree below it—no matter how deep—without passing it explicitly through props.
通常,父组件通过props传递属性信息给子组件,但是如果通过这种方法需要不断的传递很中间组件的话,就变的非常冗余,Context 让父组件能够传递信息给组件树上的任意组件,无论层级多深,不用通过props显示传递
Usually, you will pass information from a parent component to a child component via props. But passing props can become verbose and inconvenient if you have to pass them through many components in the middle, or if many components in your app need the same information. Context lets the parent component make some information available to any component in the tree below it—no matter how deep—without passing it explicitly through props.
通常,父组件通过props传递属性信息给子组件,但是如果通过这种方法需要不断的传递很中间组件的话,就变的非常冗余,Context 让父组件能够传递信息给组件树上的任意组件,无论层级多深,不用通过props显示传递
展开
评论
点赞
赞了这篇文章
赞了这篇沸点
赞了这篇文章
程序员每日英语useLayoutEffect is a version of useEffect that fires before the browser repaints the screen.
useLayoutEffect 是useEffect 的另一个版本,它在浏览器重绘之前被调用
fires: 开火 这里翻译成被触发,被调用。
useLayoutEffect 是useEffect 的另一个版本,它在浏览器重绘之前被调用
fires: 开火 这里翻译成被触发,被调用。
展开
1
1
程序员每日英语
In Strict Mode, React will call your component function twice in order to help you find accidental impurities. This is development-only behavior and does not affect production. Each ref object will be created twice, but one of the versions will be discarded. If your component function is pure (as it should be), this should not affect the behavior.
在严格模式下,react回调用你的组件2次,为了帮助你找到没有预料的错误(瑕疵),这个行为只在开发模式存在,而且不会影响生产,每个ref对象将会被创建2次,其中一个版本会被废弃,如果你的组件函数是纯函数(它应该是纯函数),这种行为不会对组件的行为造成任何影响。
impurities:n.杂质(impurity 的复数)
discarded: adj.丢弃的;废弃的
最后一句话好难翻译啊 !!!
In Strict Mode, React will call your component function twice in order to help you find accidental impurities. This is development-only behavior and does not affect production. Each ref object will be created twice, but one of the versions will be discarded. If your component function is pure (as it should be), this should not affect the behavior.
在严格模式下,react回调用你的组件2次,为了帮助你找到没有预料的错误(瑕疵),这个行为只在开发模式存在,而且不会影响生产,每个ref对象将会被创建2次,其中一个版本会被废弃,如果你的组件函数是纯函数(它应该是纯函数),这种行为不会对组件的行为造成任何影响。
impurities:n.杂质(impurity 的复数)
discarded: adj.丢弃的;废弃的
最后一句话好难翻译啊 !!!
展开
1
点赞
程序员每日英语
React, and many other UI libraries, model UI as a tree. Thinking of your app as a tree is useful for understanding the relationship between components. This understanding will help you debug future concepts like performance and state management.
React 和其他UI库,使用树的模型来描述UI,想象下通过将应用作为树结构,能让你能够更好的理解组件间关系,这种理解也能够帮助你明白一些后续的概念 如性能和状态管理。
React, and many other UI libraries, model UI as a tree. Thinking of your app as a tree is useful for understanding the relationship between components. This understanding will help you debug future concepts like performance and state management.
React 和其他UI库,使用树的模型来描述UI,想象下通过将应用作为树结构,能让你能够更好的理解组件间关系,这种理解也能够帮助你明白一些后续的概念 如性能和状态管理。
展开
1
点赞