roblox-ts

Unsupported Features

A list of limitations and unsupported features with the Roact library and roblox-ts.

These are the parts of JSX that arent supported by roblox-ts/rbx-roact right now, either due to limitations of Roact or due to not yet being implemented.

Text between elements Roact Limitation

roblox-ts will explicitly show an error message about this during compilation.

const element = <frame>Text here is not supported</frame>;

Boolean attribute defaulting to “true”

roblox-ts will silently fail on this.

const element = <frame Active/>;

Expressions Roact Limitation

Disallowed

roblox-ts will explicitly error if you try and use literal expressions

String

const element = <frame>{"Hello, World!"}</frame>;

Number, or any sort of numeric expression

const element = <frame>{10}</frame>;

Variable

In later versions of roblox-ts (> 0.0.18), Variables of type Roact.Element[] or Roact.Element are allowed.

const element = <frame>{variable}</frame>;

Arrow Function

const element = <frame>{() => ...}</frame>;

Allowed

Function Call (Roact.Element return type only)

function test(): Roact.Element {
    return <frame/>;
}

const element = <screengui>{test()}</screengui>;

The features below are only available > 0.0.18!

Function/Variable that returns Roact.Element[]

function test(): Roact.Element[] {
    return [<frame/>, <frame/>];
}

const element = <screengui>{test()}</screengui>;
const variable = [<frame/>, <frame/>];
const element = <screengui>{variable}</screengui>;