Preact X, Preact render to string & Styled Components
See original GitHub issueHey,
I’m trying to get styled-components@4.x
to work with preact@10.0.0-alpha.2
and preact-render-to-string
. But I’m always getting an error saying that react
could not be found. Not sure if this is a bug or my configuration is wrong.
Steps:
- Check sandbox on https://codesandbox.io/s/ojv1j96739
Expected Result:
- Renders
h1
tag - Writes stylesheets into console
Actual Result:
Could not find dependency: ‘react’ relative to ‘/node_modules/styled-components/dist/styled-components.browser.cjs.js’
Styled Components Doc on SSR: https://www.styled-components.com/docs/advanced#server-side-rendering
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Upgrading from Preact 8.x
This document is intended to guide you through upgrading an existing Preact 8.x application to Preact X and is divided in 3 main...
Read more >preact-x-styled-components-ssr - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >Top 5 preact-render-to-string Code Examples | Snyk
To help you get started, we've selected a few preact-render-to-string examples, based on popular ways it is used in public projects. Secure your...
Read more >Preact - Releases
Preact - ⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM. - Releases.
Read more >preact-render-to-string - npm
Render JSX to an HTML string, with support for Preact components.. Latest version: 5.2.6, last published: 2 months ago.
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
Have you got an entry in your webpack like this:
Just released
preact-render-to-string@5.0.3
which includes support for thecreateContext
-API 🎉https://github.com/developit/preact-render-to-string/releases/tag/5.0.3