Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[devtools-rfcs] Preferred method for adding static properties to components

5 views
Skip to first unread message

Julian Descottes

unread,
Oct 21, 2017, 12:58:19 PM10/21/17
to dev-developer-tools
A new proposal has been posted on https://github.com/devtools-html/rfcs

subject: Preferred method for adding static properties to components
link: https://github.com/devtools-html/rfcs/issues/24

> I have created an AST transformer to change our ES5 classes to ES6.
>
> At the moment it adds static properties like this:
>
> ```
> class Font extends Component {
> ...
> }
>
> Font.displayName = "Font";
> etc.
> ```
>
> But we could keep all the static properties inside the class body like
this:
>
> ```
> class Font extends Component {
> static get displayName() {
> return "BoxModelMain"
> }
> ...
> }
> ```
>
> Which do you prefer? It makes sense for us to have a consensus before we
change
> a gazillion files.

Comment on the GitHub issue if you want to join the conversation!

Michael (work)

unread,
Oct 24, 2017, 4:45:35 AM10/24/17
to dev-developer-tools
A new proposal has been posted on https://github.com/devtools-html/rfcs

subject: Preferred method for adding static properties to components
link: https://github.com/devtools-html/rfcs/issues/25

> @rickychien has requested that we remove displayName because
according toa React document [1], you don’t need to set it explicitly.
>
> Of course, it was never needed for Components created using
createClass() either but whilst we are changing lots of components at
the same time let's get this right.
>
> Should displayName live or die? You decide!
>
> You can use the thumbs up or thumbs down icons to vote quickly.
>
> [1] https://reactjs.org/docs/react-component.html#displayname

Comment on the GitHub issue if you want to join the conversation!
_______________________________________________
dev-developer-tools mailing list
dev-devel...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-developer-tools
0 new messages