{"action":"created","issue":{"url":"https://api.github.com/repos/react-native-community/react-native-svg/issues/789","repository_url":"https://api.github.com/repos/react-native-community/react-native-svg","labels_url":"https://api.github.com/repos/react-native-community/react-native-svg/issues/789/labels{/name}","comments_url":"https://api.github.com/repos/react-native-community/react-native-svg/issues/789/comments","events_url":"https://api.github.com/repos/react-native-community/react-native-svg/issues/789/events","html_url":"https://github.com/react-native-community/react-native-svg/issues/789","id":362811591,"node_id":"MDU6SXNzdWUzNjI4MTE1OTE=","number":789,"title":"Removing child elements causes crash (Android, 7.0.3)","user":{"login":"Bindernews","id":1190457,"node_id":"MDQ6VXNlcjExOTA0NTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1190457?v=4","gravatar_id":"","url":"https://api.github.com/users/Bindernews","html_url":"https://github.com/Bindernews","followers_url":"https://api.github.com/users/Bindernews/followers","following_url":"https://api.github.com/users/Bindernews/following{/other_user}","gists_url":"https://api.github.com/users/Bindernews/gists{/gist_id}","starred_url":"https://api.github.com/users/Bindernews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bindernews/subscriptions","organizations_url":"https://api.github.com/users/Bindernews/orgs","repos_url":"https://api.github.com/users/Bindernews/repos","events_url":"https://api.github.com/users/Bindernews/events{/privacy}","received_events_url":"https://api.github.com/users/Bindernews/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-09-22T00:43:18Z","updated_at":"2018-12-09T04:41:32Z","closed_at":null,"author_association":"NONE","body":"I'm running into issues when I try to remove a child from an <Svg> element. \r\n\r\nPlatform: Android\r\nreact-native: 0.57.0\r\nreact-native-svg: 7.0.3\r\n\r\nHere's a picture of the error:\r\n<img src=\"https://user-images.githubusercontent.com/1190457/45911085-f5420700-bddc-11e8-97be-6acfcbc264d8.png\" width=\"400\" />\r\n\r\nIt appears that React is trying to manage the removal of one of the native SVG components, but you've already removed it, but I'm not too familiar with React Native development.\r\n\r\nHere's the reproduction code. Click the button at the top to add the line, then click again to cause the crash.\r\n```JavaScript\r\nimport React from 'react';\r\nimport { Button, Dimensions, StyleSheet, View, } from 'react-native';\r\nimport Svg, { Polyline } from 'react-native-svg';\r\n\r\nconst { width, height } = Dimensions.get('window');\r\n\r\nexport default class SVGFail extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = {\r\n      showLine: false\r\n    };\r\n  }\r\n\r\n  toggleLine = () => {\r\n    this.setState({ showLine: !this.state.showLine });\r\n  }\r\n\r\n  render() {\r\n    const { showLine } = this.state;\r\n    return (\r\n      <View\r\n        style={styles.container}\r\n      >\r\n        <Button\r\n          title=\"Toggle Line\"\r\n          onPress={this.toggleLine}\r\n        />\r\n        <Svg\r\n          width={width}\r\n          height={height}\r\n        >\r\n          {showLine ? (\r\n            <Polyline\r\n              points={'10,10 100,100 150,100 100,150'}\r\n              fill=\"none\"\r\n              stroke=\"red\"\r\n              strokeWidth=\"1\"\r\n            />\r\n          ) : (\r\n            null\r\n          )}\r\n        </Svg>\r\n      </View>\r\n    );\r\n  }\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n  container: {\r\n    flex: 1,\r\n    flexDirection: 'column',\r\n    backgroundColor: 'beige',\r\n  },\r\n});\r\n```\r\n\r\n**UPDATE:**\r\nAfter some debugging, the error occurs in NativeViewHierarchyManager.java when React tries to remove the child from the SvgView, but there isn't a child in SvgView to remove. Well, SvgView overrides the `addView` method and only adds children if they are not instances of `RenderableView`, which means that somehow SvgView never ends up with children, despite displaying the content. I'm not familiar enough with the code base to be able to help more.\r\n\r\n**UPDATE 2:**\r\nEverything works when I wrap my polylines with a `<G>` tag, which is great, but this is still a valid bug.\r\n"},"comment":{"url":"https://api.github.com/repos/react-native-community/react-native-svg/issues/comments/445510753","html_url":"https://github.com/react-native-community/react-native-svg/issues/789#issuecomment-445510753","issue_url":"https://api.github.com/repos/react-native-community/react-native-svg/issues/789","id":445510753,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTUxMDc1Mw==","user":{"login":"msand","id":1131362,"node_id":"MDQ6VXNlcjExMzEzNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/1131362?v=4","gravatar_id":"","url":"https://api.github.com/users/msand","html_url":"https://github.com/msand","followers_url":"https://api.github.com/users/msand/followers","following_url":"https://api.github.com/users/msand/following{/other_user}","gists_url":"https://api.github.com/users/msand/gists{/gist_id}","starred_url":"https://api.github.com/users/msand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msand/subscriptions","organizations_url":"https://api.github.com/users/msand/orgs","repos_url":"https://api.github.com/users/msand/repos","events_url":"https://api.github.com/users/msand/events{/privacy}","received_events_url":"https://api.github.com/users/msand/received_events","type":"User","site_admin":false},"created_at":"2018-12-09T04:41:32Z","updated_at":"2018-12-09T04:41:32Z","author_association":"COLLABORATOR","body":"Is this still an issue?"}}
{"actor":{"display_login":"msand"}}