Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Problems with StoreState #182

Closed
a455047 opened this issue Aug 23, 2018 · 8 comments
Closed

Problems with StoreState #182

a455047 opened this issue Aug 23, 2018 · 8 comments

Comments

@a455047
Copy link

a455047 commented Aug 23, 2018

\TypeScript-React-Starter\src*index.tsx* has problem with const store = createStore

Error '(12,27): Expected 4 type arguments, but got 1.'

@geekyme
Copy link

geekyme commented Aug 24, 2018

#140

@JamesSkemp
Copy link

Saw that issue before I kept digging, and I'm wondering if a) that's the correct solution and the tutorial needs to be updated or b) the individual accidentally closed the issue when making their comment and the tutorial still needs to be updated with the correct solution.

@a455047
Copy link
Author

a455047 commented Aug 27, 2018

I tried solution from #140, but doesn't work unless I'm missing something...
see original error and updated/modified version attached

27-08-18 10 10 59 am
27-08-18 10 10 24 am

@JamesSkemp
Copy link

@a455047 you have IStoreState instead of just keeping StoreState. I think that might fix one of the errors.

@a455047
Copy link
Author

a455047 commented Aug 28, 2018

Thanks James! See updated working version below:

import * as React from 'react';
import * as ReactDOM from 'react-dom';

import Hello from './containers/Hello';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import { enthusiasm } from './reducers/index';
import { StoreState } from './types/index';

import './index.css';

import { EnthusiasmAction } from './actions/index';

const store = createStore<StoreState, EnthusiasmAction, any, any>(enthusiasm, {
enthusiasmLevel: 1,
languageName: 'TypeScript'
});

ReactDOM.render(


,
document.getElementById('root') as HTMLElement
);

Cheers

@a455047 a455047 closed this as completed Aug 28, 2018
@mdgrech
Copy link

mdgrech commented Sep 6, 2018

The solution above works for me but I thought using any was a no no?

@bhellema
Copy link

What's the current state of this solution? Working through a broken demo is discouraging.

@tpetrina
Copy link

You can just wait for facebook/create-react-app#4837 to be finished and just use TypeScript natively with CRA 2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants