Skip to content

Bug: nested <text> elements not supported. #438

@dhleong

Description

@dhleong

I would expect to be able to do something like this:

function App() {
  return (
    <box alignItems="center" justifyContent="center" flexGrow={1}>
      <box justifyContent="center" alignItems="flex-end">
        <ascii-font font="tiny" text="OpenTUI" />
        <text attributes={TextAttributes.DIM}>What will you
          <text attributes={TextAttributes.UNDERLINE}>build?</text>
        </text>
      </box>
    </box>
  );
}

and have the build? text show both dim and underlined, but instead I get an error that:

Error: TextNodeRenderable only accepts strings, TextNodeRenderable instances, or StyledText instances 

Is there an expected way to compose text like this? The error message suggests this should work, though peeking in briefly it seems that the react module is using a TextBufferRenderable and not a TextNodeRenderable....

Metadata

Metadata

Assignees

Labels

coreThis relates to the core packageenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions