Use React component in JSX

22 views
Skip to first unread message

Michal Sänger

unread,
Jan 12, 2015, 6:21:48 PM1/12/15
to est...@googlegroups.com
I'm happy JSX is supported in Este, but how can I reuse my component in another when writing it in JSX? What is the "custom tag" that I should use?

Daniel Steigerwald

unread,
Jan 13, 2015, 3:08:05 AM1/13/15
to est...@googlegroups.com

On Tue, Jan 13, 2015 at 12:21 AM, Michal Sänger <michal...@gmail.com> wrote:
I'm happy JSX is supported in Este, but how can I reuse my component in another when writing it in JSX? What is the "custom tag" that I should use?

--
You received this message because you are subscribed to the Google Groups "Este.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to estejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michal Sänger

unread,
Jan 13, 2015, 9:03:51 AM1/13/15
to est...@googlegroups.com
Songary does not have any .jsx files. So you are telling me not to use JSX but the coffee syntax?

Michal

Daniel Steigerwald

unread,
Jan 14, 2015, 5:35:30 AM1/14/15
to est...@googlegroups.com
You have two options:

Do it as Este/Songary. It means, every component has its wrapper for DI, and React class is stored as property component.

React Class with wrapper
https://github.com/steida/songary/blob/master/app/client/js/songs/react/songspage.coffee#L20

I prefer DI over props and wrappers, but it's mine approach.

You can use React suggested approach. No wrappers, your React class will be provided via goog.provide, and required via goog.require. No DI, just passing everything through React props.


Reply all
Reply to author
Forward
0 new messages