ART library does not work in react native

Viewed 812

I try to use ART library in react-native build in android phone, but no matter what I put in Shape aways rendering a black image, like this:

enter image description here

My code:

import React from 'react';
import {
ART,
StyleSheet,
View,
Button,
} from 'react-native';

const {
Group,
Shape,
Surface,
} = ART;


export default class App extends React.Component {
    render() {
        return (
        <View style={styles.container}>
            <Surface width={500} height={500}>
                <Group x={0} y={0}>
                    <Shape
                      d="M10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80"
                      stroke="#555"
                      strokeWidth={1}
                     />
                </Group>
            </Surface>
        </View>
        );
    }
}
2 Answers

The appState solution in react-native-circular-progress works for me. I did have the issue when the ART was loaded on the initial screen. In that case calling setState twice within the appState handler seemed to solve the problem.

_handleAppStateChange = (nextAppState) => {
    this.setState({ appState: 'random_value' });
    this.setState({ appState: nextAppState });
}
Related