Skip to content

Text: negative dynamic numberOfLines are left unclamped #28

Description

@mfkrause

Surfaced by the new parity fuzzer from #26.

RN's Text clamps a negative numberOfLines to 0 at runtime. Boost replicates this only when the value is a numeric literal at build time. A non-literal value (a variable reference, or a value arriving through a spread) is left untouched, so the native host receives the negative number, which is invalid.

Repro

const n = () => -1;
<Text numberOfLines={n()}>hello</Text>
  • Expected: numberOfLines: 0
  • Actual: numberOfLines: -1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions