Skip to content

Cannot style <Text> within <Text> #474

Closed
@varun531

Description

@varun531

I am...

| -------------------------------------------------------------------------------------------------

Reporting a bug or issue

Expected behavior:

A multiline block of text should be able to have an arbitrary word (or words) within it styled separately. i.e.

The quick brown fox\n
jumped over the\n
lazy dog

Here the newlines are added for clarity to show where the text might be forced to wrap.

Observed behavior:

This just isn't possible. Attempting to nest <Text> within <Text> results in the following error:

Error: "sketch_text" is not a valid child for Text components

How to reproduce:

Try to render this code:

<Text style={{...}}>Text styled one way,<Text style={{...}}>text styled another way.</Text></Text>

Sketch version:

61.2

I feel like this is a reasonable thing to request, because not being able to do so significantly hampers the ability to design things like the following:

Screen Shot 2020-01-20 at 5 13 26 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions