Comments (12)
That makes sense. I'm using styled-components
and their v2/next branch... works great with SSR! I'll use my own fork of your lib in the meantime, let me know if you need any help!
from flexbox-react.
Ok, copied. I will resume my styled-components
port.
from flexbox-react.
v4.3.0 is up @hampusohlsson. Should be working now.
from flexbox-react.
Btw, I looked through your source-code and saw that you depend on rofrischmann/inline-style-prefixer which is probably generating those properties.. Digging even deeper, this style of concatenating display props seem to have originated from internal behavior in the React core, see facebook/react#2020.
Edit:
My guess is there was an update to Chrome that removed the support for this style of css?
Support was dropped in React 15.
from flexbox-react.
Mhm. So, while this approach you are proposing works, it doesn't quite follows the API design I intended with this library, which is not having a single proprietary concept on it. To use this library you don't need to learn anything. And having a noPrefix
doesn't continues that idea, I'm afraid. I'm starting to think the best approach would be to get rid of inline-style-prefixer
and move to something like glamor
, aphrodite
, or styled-components
under the hood. Yes, this would imply a major re-write of the library, but the library is not big, so it's totally doable. I feel bad because I'm genuinely grateful to you for taking the time to submit an issue, investigate on it and submit a PR, but this is not the approach we should follow, in my opinion. Ideally everything should work as it is, both SSR and CSR, in a frictionless, transparent way. I'll try to migrate to glamor
, aphrodite
, or styled-components
shortly and see how it goes.
from flexbox-react.
Hey @hampusohlsson, I have good news.
All of those libraries I mentioned on my comment (glamor
, aphrodite
, or styled-components
) are listed here, using the library. They are using the static version of the library. It's actually a minimal change!
I'll publish the fix right away. And the size of the library is going to be smaller now!
from flexbox-react.
Hey, thanks for the quick turnaround. I actually tried that, but the static version also outputs concatenated string so it is the same problem -even worse actually, the layout doesn't work at all since the client code uses the same property.
from flexbox-react.
But that's weird, styled-components
, glamor
and all those libraries work when SSR 🤔
from flexbox-react.
The issue is that you can't do the right thing using inline styles (one display prop on each row). Styled-components outputs classnames with css injected into the body, so they have no problem generating multiple lines.
from flexbox-react.
Wow! That was fast 😅 will try it out in a few hours.
from flexbox-react.
Hey @nachoaIvarez, I just tried v4.3.0
but my SSR doesn't render any output -- I see that you are using [email protected]
in the package.json
. It's the styled-components@next
branch that has support for SSR. If you don't want to rely on a third party beta branch, perhaps you too could create a next
branch that does until styled-components v2
lands in master?
from flexbox-react.
FYI, works perfectly with styled-components v2! Just tried it in a local branch 😄
from flexbox-react.
Related Issues (20)
- Exclude @types/react & @types/react-dom from dependencies HOT 2
- ref implementation is not working
- 4.3.0 will force children to be recreated - does not happen in 4.2.1 HOT 15
- className attribute missing from typescript typings HOT 1
- Wrapping an input will cause the input to loose focus after onChange HOT 1
- 4.3.0 kills my app HOT 2
- key prop?
- Can't specificy flexShrink 0
- @types/react/index.d.ts compile failure HOT 2
- Warning: Failed prop type: Invalid prop `element` of value `li` supplied to `Styled(Component)`
- Typo "propietary" in repo description
- Support for React v16? HOT 2
- Support overflow
- Non-flex children not supported for typescript
- Failed to build 2.0.0
- It makes styled-components doesn't work. HOT 5
- Add justifyContent: 'space-evenly' to Flexbox.propTypes HOT 2
- Npm dist does not seem to reflect latest version
- TypeScript with render props HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexbox-react.