Welcome to the React feedback portal. We’re happy you’re here! If you have feedback on how to improve the React, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

Your TextAreaComponent, even when used with no child elements, will trigger a react dev warning.

It's easy to demonstrate using your own samples - if you open the first sample from Getting Started in the docs in Stackblitz you'll see a warning on the console:

https://ej2.syncfusion.com/react/documentation/textarea/getting-started

That warning is:

Warning: Use the `defaultValue` or `value` props instead of setting children on <textarea>

The reason for the warning is a bug in this line of code in textarea.component.tsx:

return React.createElement('textarea', this.getDefaultAttributes(),[].concat(this.props.children,this.portals));

If this.props.children is undefined (which it will be if no child elements are placed under TextAreaComponent) then the result of the concat (if this.portals is an empty array) is:

[undefined]

Passing any array, even an empty one, as children into createElement will count as children having been specified (undefined or null needs to be passed instead for it to count as no children having been specified).

So to fix this I think you'd instead need something like these two lines instead (so if there are no children and no portals then undefined will get passed as children to createElement):

const children = [].concat(this.props.children === undefined ? this.props.children : [],this.portals);

return React.createElement('textarea', this.getDefaultAttributes(),children.length ? children : undefined);
I've noticed that you have this same pattern of calling React.createElement in many (all?) of your react components - I guess for most of them either they're intended to have children passed or it doesn't matter if [] or [undefined] gets passed to createElement as children even when the user of the component isn't passing children, it's just for textarea obviously React warns about passing any children.