question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS application crash when use <TSpan> with spaces as text

See original GitHub issue

Hello, guys, just noticed a problem when I use <TSpan> element with text which contains only space symbols (or just one space symbol) iOS application causes crash. Android application works fine.

It can be reproduced on empty app with imported Svg, Text, TSpan inside <View>.

<Svg
      version="1.1"
      id="test"
      xmlns="http://www.w3.org/2000/svg"
      xmlnsXlink="http://www.w3.org/1999/xlink"
      style={{ width: 200, height: 200 }}
      viewBox="0 0 200 200"
    >
  <G>
    <Text x="0" y="0">
       <TSpan x="0" dy="10" letterSpacing="1">{' '}</TSpan>
    <Text>
  </G>
</Svg>

“react”: “16.6.1”, “react-native”: “0.57.7”, “react-native-svg”: “9.0.0”, (same on 8.x.x)

Mac OS 10.14.2 High Sierra Xcode v10.1 NodeJS v10.13.0 npm v6.4.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
msandcommented, Jan 22, 2019

Unable to replicate in v9.0.1 with this at least:

import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { G, Text, TSpan, Svg } from 'react-native-svg';

export default class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Svg
          version="1.1"
          id="test"
          xmlns="http://www.w3.org/2000/svg"
          xmlnsXlink="http://www.w3.org/1999/xlink"
          style={{ width: 200, height: 200 }}
          viewBox="0 0 200 200"
        >
          <G>
            <Text x="0" y="0">
              <TSpan x="0" dy="10" letterSpacing="1">{' '}</TSpan>
            </Text>
          </G>
        </Svg>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#ecf0f1',
  },
});

0reactions
oleksandr-dziubancommented, Feb 8, 2019

@msand Confirmed issue cannot be reproduced now. I’m closing this issues. Thanks a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS application crash when use <TSpan> with spaces as text
Hello, guys, just noticed a problem when I use element with text which contains only space symbols (or just one space symbol) iOS...
Read more >
Assign text in "Text View" to a variable makes app crash
ios - Assign text in "Text View" to a variable makes app crash - Stack Overflow. Stack Overflow for Teams – Start collaborating...
Read more >
iOS14 Crash (EXC_BAD_ACCESS KERN_I…
This problem does not occur to all users (approximately one in a thousand), but the user who reinstalls the app still crashes in...
Read more >
How to Fix Crashing Apps on iPhone & iPad | OSXDaily
The best approach for app crashing issues is to try to force reboot the iPhone or iPad by holding down the Power button...
Read more >
class="Apple-style-span" should not be added by rich text editor
This issue is still exist. It happen when users type fast and when users copy/paste into the editor. Comment 14 by schedule grego.....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found