我正在使用react color picker来更改更改状态(每秒多次)。因为状态更改了我的组成部分,并且所有子项都被重新渲染。 我对子代没有任何控制权,因为它们是从其他库(reactstrap和react-fontawesome)中导入的,因此我需要一种方法来防止它们从父容器中更新。
我可以使用自定义# adds the lib folder to not specify prefix everytime
link_directories( /usr/local/lib/ )
target_link_libraries( "<all opencv libs from /usr/local/lib>" )
# adds the includes (dunno if this needed but had to do it in my project)
# but I think only if opencv includes are not located in your project
# root dir
target_include_directories( "/usr/local/include/opencv" or "/usr/local/include/opencv2" ) # depends what you use
创建一个包装器组件,但是该解决方案似乎有点怪异,所以我很好奇是否有针对此的解决方案。
我代码的相关部分:
shouldComponentUpdate()
我的某些navItems依赖于实时颜色信息,但大多数不依赖