Я преобразовал свой контейнер в файл .jsx, но теперь я получаю следующие ошибки в моих HTML-элементах в методе рендеринга:
Свойство не существует для типа 'JSX.IntrinsicElements.div
Свойство не существует для типа 'JSX.IntrinsicElements.h1
package.json
{
"name": "moonholdings.io",
"version": "0.1.0",
"private": true,
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/ --source-map",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive --source-map",
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"dependencies": {
"node-sass-chokidar": "^1.3.3",
"react": "^16.5.1",
"react-dom": "^16.5.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts-ts": "2.17.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/react": "^16.4.14",
"@types/react-dom": "^16.0.5",
"@types/react-redux": "^6.0.9",
"@types/react-router": "^4.0.25",
"@types/react-router-dom": "^4.2.6",
"@types/react-router-redux": "^5.0.14",
"@types/redux": "^3.6.31",
"ramda": "^0.25.0",
"typescript": "^3.0.3"
}
}
loginContainer.js
import * as React from 'react';
import { connect } from 'react-redux';
// Actions
// import { addCoins } from 'actions/coins';
interface IProps {
loginActions: any
}
interface IState {
email: string;
password: string;
}
class LoginContainer extends React.Component<IProps, IState> {
public state: IState = {
email: '',
password: ''
};
public render() {
return (
<div id="login-container">
<h1>Login</h1>
</div>
);
}
}
// const mapDispatchToProps = dispatch => ({
// addCoins: (...args) => dispatch(addCoins(...args))
// });
export const LoginContainerJest = LoginContainer;
export default connect(null, null)(LoginContainer);
У меня есть rm -R node_modules, я также видел, что дважды установил "@types/react-redux"
, но я это исправил.Переустановил Typescript и все равно получаю такую же (2312,14): Duplicate identifier 'LibraryManagedAttributes'.
Ошибка: (