\TypeScript-React-Starter\src*index.tsx* has problem with const store = createStore
Error '(12,27): Expected 4 type arguments, but got 1.'
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.
I tried solution from #140, but doesn't work unless I'm missing something...
see original error and updated/modified version attached


@a455047 you have IStoreState instead of just keeping StoreState. I think that might fix one of the errors.
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
enthusiasmLevel: 1,
languageName: 'TypeScript'
});
ReactDOM.render(
,
document.getElementById('root') as HTMLElement
);
Cheers
The solution above works for me but I thought using any was a no no?
What's the current state of this solution? Working through a broken demo is discouraging.
You can just wait for https://github.com/facebook/create-react-app/pull/4837 to be finished and just use TypeScript natively with CRA 2.
Most helpful comment
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(enthusiasm, {
enthusiasmLevel: 1,
languageName: 'TypeScript'
});
ReactDOM.render(
,
document.getElementById('root') as HTMLElement
);
Cheers