Skip to content

Preserve & pass-through unmapped props #6

@gbirke

Description

@gbirke

I'd like to create a component that has some props connected to the store and some props exposed. When I call connect on a component, I get a new component that has no props. What I would like to have is a new connected component where only the props that were defined in the mapStateToProps and mapActionsToProps are no longer exposed and the other props are still settable.

Maybe there is a workaround (except for putting non-store related code into mapStateToProps)?

Some example code:

import MyComp from './MyComp';

ConnectedMyComp = connect(mapStateToProps)(MyComp)

new Vue({
  el: '#app',
  render: h => h(ConnectedMyComp, {
     // This does not work
    props: {
      nonMappedProp: 'Foo'
    }
   })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions