0

I tried this but get an error "TypeError: this._viewCreator[type] is not a function".

Should I not import from React Native or use another library?

import {ART} from 'react-native'

const {
  Shape,
  Path,
} = ART

class Circle extends React.Component {
  render() {
    const {radius, ...rest} = this.props

    const circle = Path()
      .move(radius, 0)
      .arc(0, radius * 2, radius)
      .arc(0, radius * -2, radius)

    return <Shape {...rest} d={circle} />
  }

...

<Circle radius={10} fill={blue} />

Thanks!

Jan F.
  • 1,681
  • 2
  • 15
  • 27

1 Answers1

0

You can use Cylinder with 0 dimHeight:

 <Cylinder
   radiusTop={1}
   dimHeight={0}
   segments={32}
 />
Alan Wołejko
  • 442
  • 2
  • 5
  • 20