InputSwitch offLabel/onLabel

UI Components for React
Post Reply
JLudwig
Posts: 10
Joined: 20 Feb 2019, 10:36

12 Mar 2020, 17:08

I want so set "offLabel" and "onLabel" for InputSwitch but there are two errors:

i) Warning: Unknown event handler property `onLabel`. It will be ignored.

ii) Warning: React does not recognize the `offLabel` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `offlabel` instead.

I'm using PrimeReact 4.1.0 with Serenity Template.

Does sombody know how to fix that? The labels are not shown.

cagatay.civici
Prime
Posts: 18223
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Mar 2020, 17:09

onLabel and offLabel are not supported properties;

https://www.primefaces.org/primereact/s ... nputswitch

JLudwig
Posts: 10
Joined: 20 Feb 2019, 10:36

12 Mar 2020, 17:12

Then the docu should be changed:

Customization

Labels can be customized with onLabel and offLabel properties.

<InputSwitch onLabel="Yes" offLabel="No" checked={this.state.value} onChange={(e) => this.setState({value: e.value})} />

cagatay.civici
Prime
Posts: 18223
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Mar 2020, 17:14


Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests