I\'m trying to implement a handler, in React, for a survey implemented in SurveyJS. This is for multiple-choice questions that may have answers like \"None of the Above\" or \"P
The most likely cause for this is that you don't specify the type for your component's state in its class definition, so it defaults to {}
. You can fix it by declaring interfaces for the types of props and state and providing these as type arguments to React.Component:
interface MyComponentProps { /* declare your component's props here */ }
interface MyComponentState { ValueChanging : boolean }
class MyComponent extends React.Component {
constructor(props) {
...
You could provide the types directly between the <
and >
, but using interfaces usually leads to more readable code and promotes reuse. To prevent confusion with components it's also a good idea to use lower-case identifiers for the properties on props and state.