Comments (8)
@bennett000 @yuri @winkerVSbecks @bertrandk @rbrander @andrejkn
from rangle-starter.
Current issues:
redux-react's connect
typing won't accept a functional stateless component:
ERROR in ./src/containers/App.tsx
(73,3): error TS2345: Argument of type '({ children, session, login, logout }: { children: any; session: any; login: any; logout: any; })...' is not assignable to parameter of type 'typeof ElementClass'.
Type '({ children, session, login, logout }: { children: any; session: any; login: any; logout: any; })...' provides no match for the signature 'new (props?: any, context?: any): ElementClass'
from rangle-starter.
2: Same thing for reduxForm
:
ERROR in ./src/components/LoginForm.tsx
(79,4): error TS2345: Argument of type '({
handleSubmit,
resetForm,
isPending,
hasError,
fields: {
username,
password,
...' is not assignable to parameter of type 'typeof ElementClass'.
from rangle-starter.
@SethDavenport official typings coming soon: reduxjs/redux#1413
from rangle-starter.
That's cool - I can work around (1) in the meantime by converting my containers to class
components.
However redux-form
typings have the same issue. I'm also expecting Radium to have it as well, although I haven't tried it yet. Actually not sure Radium even has typings...
from rangle-starter.
@winkerVSbecks - that PR is for redux, which is great. But I'm talking about connect()
from react-redux
.
export function connect(mapStateToProps?: MapStateToProps,
mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject,
mergeProps?: MergeProps,
options?: Options): ClassDecorator;
We need an overload of this that doesn't return ClassDecorator, but rather something that can decorate StatelessComponent<P>
Might make a PR to DefinitelyTyped at some point.
from rangle-starter.
@SethDavenport yes, my bad. @bennett000 mentioned that DefinitelyTyped has kind of stalled at this point. Since, Redux is bringing typings into the main repo we should probably do the same for react-redux, etc.
from rangle-starter.
It would be good to include a pass-through property or two (properties provided by the parent component) in e.g. counter-page.tsx, since this takes a long time to puzzle out how to fix the first time. (For me, the solution was to create an IOwnProps
interface for them:
interface IState { tab: string }
interface IDispatch { onTabChange: (any)=>void }
interface IOwnProps { title:string }
export class YnAppBarView extends Component<IState & IDispatch & IOwnProps, {}> {
... and then set it as ownProps on the connect:
const mapStateToProps =
(state, props:IOwnProps)=>({
myProp: state.yadayada // e.g.
})
but you may well have a better way to handle this!
from rangle-starter.
Related Issues (20)
- how to run? HOT 8
- Angular 1 Dependencies
- Replace Basscss with Tachyons
- Angular 2 Example Upgrade HOT 6
- update redux form to version 6 HOT 1
- change typings.json system to @types HOT 3
- npm run test doesn't run any tests HOT 2
- Update circle.yml to use built in yarn HOT 3
- Use @rangle scope for npm
- Update typescript dependencies to 2.1.x to simplify Webpack configuration [Angular 2] HOT 1
- (Angular2/Typescript) TypeError: Cannot read property 'exclude' of undefined HOT 19
- rangle/typescript-react-redux-example typings depressed HOT 5
- Adapt to Angular renaming HOT 2
- Make sure the starters and examples use a better redux folder naming strategy HOT 9
- has problem HOT 2
- Update angular-redux-starter HOT 2
- Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.module.rules[11] should be an object. HOT 2
- npm run dev - tooks about 6 seconds on reload HOT 1
- rangle-starter angular 2 with angular 2 material
- npm run dev proxy error [rror occurred while trying to proxy request /api/auth/login from 127.0.0.1:8080 to http://localhost:3000]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rangle-starter.