I am trying to get the working in my SPFX application and I am sure I am not getting the class correct
I have tried my code in JS and ran it with npm install and it works fine, but when I try and do it in TS with spfx I get this error:
import * as React from 'react';
import PropTypes from 'prop-types';
export const Checkbox = ({ type = 'checkbox', checked = false, onChange, id }) => {
return <input id={id} type={type} checked={checked} onChange={onChange} />;
};
Checkbox.propTypes = {
type: PropTypes.string,
name: PropTypes.string.isRequired,
checked: PropTypes.bool,
onChange: PropTypes.func.isRequired,
};
and I call it with :
return (
<label style={{display: 'block'}} key={item.id}>
<Checkbox
style={{display: 'block'}}
checked={checked}
onChange={this.handleChange}
id={item.id}
statement={item.statement}
/>
{item.statement}
</label>
My exact error is :error TS2604: JSX element type 'Checkbox' does not have any construct or call signatures.
Any ideas clever folks ?