Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Trying to remove a view index' error when using YAxis with BarChart #244

Open
1 of 2 tasks
ghost opened this issue Oct 12, 2018 · 3 comments
Open
1 of 2 tasks

'Trying to remove a view index' error when using YAxis with BarChart #244

ghost opened this issue Oct 12, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 12, 2018

What is the problem?

RN returns an error: 'trying to remove a view index'

When does it happen?

When YAxis is used with BarChart

What platform? Android

  • iOS
  • Android

React Native version: 0.57

Code to reproduce

<View style={{backgroundColor: '#fff', height: 200, flexDirection: 'row', flex: 1, marginTop: 20}}>
          <YAxis
            data={data}
            contentInset={{top: 20, bottom: 20}}
            svg={{
              fill: 'grey',
              fontSize: 10,
            }}
            numberOfTicks={6}
            formatLabel={value => `${value}`}
          />
          <BarChart
            style={{flex: 1, marginLeft: 20}}
            spacingInner={0.3}
            data={data}
            svg={{fill}}
            contentInset={{top: 20, bottom: 20}}
          >
            <Grid/>
          </BarChart>
        </View>
@lunadis
Copy link

lunadis commented Dec 12, 2018

1+

msand added a commit to software-mansion/react-native-svg that referenced this issue Feb 9, 2019
msand added a commit to software-mansion/react-native-svg that referenced this issue Feb 9, 2019
@msand
Copy link

msand commented Feb 9, 2019

Can you try with v9.2.4 of react-native-svg?

@msand
Copy link

msand commented Feb 9, 2019

The root cause is the Defs ViewManager returning nil for the shadowView, the most efficient way to workaround this if you want backwards compatibility with pre v9.2.4 is to wrap the Defs elements in a G, rather then the dynamic content.

JackWillie added a commit to JackWillie/react-native-svg that referenced this issue Nov 27, 2022
JackWillie added a commit to JackWillie/react-native-svg that referenced this issue Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants