palantir / tslint-react

:orange_book: Lint rules related to React & JSX for TSLint.
Apache License 2.0
749 stars 76 forks source link

[Suggestion] New rule: jsx-no-literal-object #191

Closed jeanbenitez closed 5 years ago

jeanbenitez commented 5 years ago

I think can be a bad practice pass an object literal via jsx prop in render, because the render will make a new object every time.

ex.:

<my-component user={{ userId: 1234 }} />

Thanks!

adidahiya commented 5 years ago

duplicate of #89