i am currently making a simple react application.
this is my index.tsx
import * as React from \'react\';
import * as ReactDOM from \'react-dom\
The problem here is not with your tslint settings. Look at the following code snippet:
interface SearchBarProps {
term: string;
optionalArgument?: string;
}
interface SearchBarState{
something: number;
}
class SearchBar extends React.Component {
constructor(props: SearchBarProps){
super(props);
this.state = {
something: 23
};
}
render() {
const {something} = this.state;
return (
{something}
)
}
}
In class SearchBar extends React.Component, SearchBarProps and SearchBarState denote type of expected props and type of state for component SearchBar respectively. You must give propTypes and stateType when you use typescript.
You can avoid giving types by using keyword any but I highly suggest you not to follow this "evil" path if you truly want to take advantage of using typescript. In your case it seems that you haven't specified type of state and used it, fixing that will solve this problem.
Edit 1
In interface SearchBarProps, optionalArgument becomes an optional argument as we add a question mark ? in front of it, so won't show any error even if you don't pass optionalArgument explicitly.
Hope this solves your problem!