Помогите вывести SVG на Expo. Если следовать https://docs.expo.io/versions/latest/sdk/svg/ и сперва установить, а затем импортировать в код модуль:
expo install react-native-svg
import Svg from 'react-native-svg';
То при запуске приложения выходит ошибка:
Цитата Tried to register two views with the same name RNSvg........
Если делать по инструкции: https://github.com/react-native-community/react-native-svg
И добавить ТОЛЬКО код:
/* Use this if you are using Expo
import { Svg } from 'expo';
*/
То всё хорошо работает и запускается. НО 1) стоит только добавить /*
const { Circle, Rect } = Svg;
*/
То при открытии конкретной страницы выходит ошибка:
undefined is not an object (evaluationg "_expo.Svg.Circle .........
2) При импорте:import { Svg, Circle, Rect } from 'expo';
И рендере: <Svg ......>
<Circle ......> <Rect.......></Svg> ниже указан полный код компонентов для рендера.
Выходит ошибка:
Invariant Violation: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Помогите пожалуйста нарисовать хотя бы фигуры из официального примера:
<Svg height="50%" width="50%" viewBox="0 0 100 100">
<Circle
cx="50"
cy="50"
r="45"
stroke="blue"
strokeWidth="2.5"
fill="green"
/>
<Rect
x="15"
y="15"
width="70"
height="70"
stroke="red"
strokeWidth="2"
fill="yellow"
/>
</Svg>