Skip to content

'SwitchSelector' cannot be used as a JSX component. #16

@CarrionB

Description

@CarrionB

Welp, I was just trying to replicate the examples, but this SwitchSelector is not working for me

import SwitchSelector from 'react-native-switch-selector';
...
const Homescreen =() => {
  ...
  const options = [
    {label: '01:00', value: '1'},
    {label: '01:30', value: '1.5'},
    {label: '02:00', value: '2'},
  ];
  return (
  ...`
         <SwitchSelector
            options={options}
            initial={0}
            onPress={value => console.log(`Call onPress with value: ${value}`)}
          />
  )
  ...
}

Error:

JSX element class does not support attributes because it does not have a 'props' property.ts(2607)
'SwitchSelector' cannot be used as a JSX component.
Its instance type 'SwitchSelector' is not a valid JSX element.
Type 'SwitchSelector' is missing the following properties from type 'ElementClass': context, setState, forceUpdate, props, refsts(2786)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions