React Redux: Use data from props or get data directly from redux-store? Which one is better?

Viewed 614

Please excuse if its a duplicate.

I was just going through some nice Open source React+Redux projects and I came through this Ory-editor in which they have tried to get the data from store directly in almost every component.

Example -

const Inner = ({
  isInsertMode,
  insertMode
}: {
  isInsertMode: boolean,
  insertMode: Function
}) => (
  <Button
    icon={<ContentAdd />}
    description="Add things"
    active={isInsertMode}
    onClick={insertMode}
  />
)

const mapStateToProps = createStructuredSelector({ isInsertMode })
const mapDispatchToProps = { insertMode }

export default connect(mapStateToProps, mapDispatchToProps)(Inner)

So this made me wonder if its a good practice to get data directly from redux-store for all components or is it better to pass the data using React props.

Which way is better and faster? And doesn't hurt React's basic principles

4 Answers
Related