Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
351 views
in Technique[技术] by (71.8m points)

javascript - React Redux中组件和容器之间的区别(Difference between component and container in react redux)

react redux中的component和container有什么区别?

  ask by Stanislav Mayorov translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Component is part of the React API.

(Component是React API的一部分。)

A Component is a class or function that describes part of a React UI.

(组件是描述React UI的一部分的类或函数。)

Container is an informal term for a React component that is connect -ed to a redux store.

(容器connect到Redux存储的React组件的非正式术语。)

Containers receive Redux state updates and dispatch actions, and they usually don't render DOM elements;

(容器接收Redux状态更新和dispatch动作,并且它们通常不呈现DOM元素。)

they delegate rendering to presentational child components.

(他们将渲染委托给演示性子组件。)

For more detail read presentational vs container components by Dan Abramov.

(有关更多详细信息,请阅读Dan Abramov的presentational vs container组件 。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...