Giter VIP home page Giter VIP logo

Comments (8)

TaylorBriggs avatar TaylorBriggs commented on September 27, 2024 1

Thanks for writing up this issue. It should support nesting <Text /> within the component. I'll have to look into why that isn't working. In the meantime, feel free to poke around the code and open a PR if you find a fix!

from react-native-typewriter.

TaylorBriggs avatar TaylorBriggs commented on September 27, 2024 1

Thanks for writing this up @nsdub. I'm looking into it and will publish a fix once I figure it out.

from react-native-typewriter.

TaylorBriggs avatar TaylorBriggs commented on September 27, 2024

There's currently no special handling for nested Text elements, that's the problem. The TypeWriter component expects children to be a string. I'll need to add an enhancement to handle nested Text correctly.

from react-native-typewriter.

nsdub avatar nsdub commented on September 27, 2024

Thanks for the follow up, Taylor!

from react-native-typewriter.

TaylorBriggs avatar TaylorBriggs commented on September 27, 2024

@nsdub I have a fix in progress, should get to complete it and publish a new version sometime this week.

from react-native-typewriter.

nsdub avatar nsdub commented on September 27, 2024

@TaylorBriggs Awesome, thanks for taking the time!

from react-native-typewriter.

TaylorBriggs avatar TaylorBriggs commented on September 27, 2024

@nsdub v0.6.0 is published to add support for nested <Text> elements.

from react-native-typewriter.

nsdub avatar nsdub commented on September 27, 2024

Thanks for the update here @TaylorBriggs!

I've been playing around with the updated package and I'm noticing that a limitation seems to be that the nested Text tag will work at the conclusion of the string, but not in the middle of a string.

Illustration using the automated test from the last release. This works as expected:

<TypeWriter typing={1} style={{fontSize: 40}}>
  Hello
  {' '}
  <Text style={{ color: 'red' }}>World!</Text>
</TypeWriter>

This does not:

<TypeWriter typing={1} style={{fontSize: 40}}>
  Hello
  {' '}
  <Text style={{ color: 'red' }}>World!</Text>
  This is TypeWriter.
</TypeWriter>

Nor does any combination of throwing 'Hello' or 'This is TypeWriter' into Text tags. From my testing, only the content up to and including the first nested Text tag gets rendered.

from react-native-typewriter.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.