Think about non-JSX users
See original GitHub issueI don’t use JSX, but libraries like glamor are still a pleasure to use:
dom.div(
{ ...style({ border: "1px solid black" }) },
children
)
The problem with styled-components is that is forces you to always create new components. So now I have to do something like this:
const Title = React.createFactory(styled.div`border: 1px solid black`);
Title({}, children);
Obviously not ideal. I don’t know if you want to care about this or not, but it’s definitely a blocker for me to use this library.
An option would be to re-export all of the tags, and have them automatically wrap the result in a createFactory
. So I would import styled-components/wrapped
or something instead, and I wouldn’t have to use createFactory
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
is it possible to mix react jsx with non jsx components?
So the question I have right now is if I have a parent component that is JSX but I have the need to...
Read more >Build A Header Component | React Fundamentals
Think of Components as the elements of user interfaces. ... In the Non-JSX version of the code, it's hard to tell what the...
Read more >React's JSX Doesn't Violate Separation of Concerns
If you see a permanent slowdown from designer productivity loss, you might have a valid reason to consider a non-JSX solution.
Read more >Thinking in React
Since you're often displaying a JSON data model to a user, you'll find that if your model was built correctly, your UI (and...
Read more >How to Check if a User is Logged In with React - YouTube
This React JS tutorial shows how to check to see if a user is logged in each time they access the application. We...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now that @jlongster made prettier to help him write JSX for
styled-components
and nobody else has asked for this use case I’ll close this issue!Why would calling
React.createFactory
be a bad thing if it was hidden inside the library? @jlongster maybe you could weigh in here?