-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@connect decorator #68
Comments
Maybe react-redux-typescript-connect-decorator-demo can be of help. Note: I didn't test it myself (yet). Original source/discussion: DefinitelyTyped/DefinitelyTyped#9951 |
@BoostIO funded this issue with $30. Visit this issue on Issuehunt |
This article I read on dev.to has a section describing how they used a connect decorator to access redux actions and state using props. https://dev.to/aalises/preact--typescript--parcel--redux-zero-rebuilding-the-qmenta-front-end-focusing-on-performance-and-minimalism-1lnp Was a great read and there is a link to a starter project implementing the decorator they created. Note: They are using Preact + Redux-zero. Question: I'm new to contributing, new to typescript as well as redux but have already planned a project to help learn all three. Would I be able to help with this issue? Is this a request to add something to the docs? |
Hey @insuusvenerati, Could you please point me to the example with mapping props? |
import { h, Component } from "preact";
import { Connect } from "redux-zero/preact";
export default function(actions = {}): any {
return Child => props => (
<Connect mapToProps={state => ({ ...state })} actions={actions}>
{mappedProps => <Child {...mappedProps} {...props} />}
</Connect>
)
} This is what I was referring to.
It may be my lack of understanding that's making it confusing though. What I wanted to do was get familiar with this subject and them maybe chime in via this issue and send a PR. |
@issuehuntfest has funded $10.00 to this issue. See it on IssueHunt |
It'd be great to see how react+redux+typescript can use the
@connect(..)
decorator syntax to connect state/actions to a component's props.The text was updated successfully, but these errors were encountered: