Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preact example. #543

Merged
merged 2 commits into from
Dec 27, 2016
Merged

Add a preact example. #543

merged 2 commits into from
Dec 27, 2016

Conversation

arunoda
Copy link
Contributor

@arunoda arunoda commented Dec 27, 2016

Added an example using preact-compat.
Here's the live version: https://hello-world-nrqihmdggp.now.sh/


## How to use

Download the example (or clone the repo)[https://github.com/zeit/next.js.git]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.git not needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied this from the hello-world example. May be we need to change this for all examples. Shall we do it with another PR?

@arunoda arunoda mentioned this pull request Dec 27, 2016
@rauchg
Copy link
Member

rauchg commented Dec 27, 2016

Yes

@rauchg rauchg merged commit 1ba315f into vercel:master Dec 27, 2016
@lukeed
Copy link
Contributor

lukeed commented Dec 27, 2016

Oh man, I was waiting to open this same PR 😉

@rauchg
Copy link
Member

rauchg commented Dec 27, 2016

Thanks @lukeed ;)

@alexnm
Copy link
Contributor

alexnm commented Dec 28, 2016

@arunoda, @rauchg
I just stumbled upon this and wanted to give it a try but it's throwing an error when navigating to /about

Uncaught (in promise) TypeError: Cannot read property '_pendingForceUpdate' of undefined
    at setPendingForceUpdate (index.js?0d84949:20)
    at traverseRenderedChildren (index.js?0d84949:6)
    at deepForceUpdate (index.js?0d84949:40)
    at AppContainer.componentWillReceiveProps (AppContainer.dev.js?0d84949:45)
    at callMethod (preact-compat.js?0c5b0f7:458)
    at AppContainer.componentWillReceiveProps (preact-compat.js?0c5b0f7:469)
    at setComponentProps (preact.js?9f0705e:276)
    at renderComponent (preact.js?9f0705e:310)
    at rerender (preact.js?9f0705e:72)

I wanted to test if this is actually loading preact instead of react and I was able to use React.createClass in one of the pages.

I haven't used preact before, maybe i'm missing something?

@developit
Copy link
Contributor

What libary is providing that deepForceUpdate() method?

@rauchg
Copy link
Member

rauchg commented Dec 31, 2016

One by @gaearon IIRC

@developit
Copy link
Contributor

Ahh perhaps React Hot Loader.

@arunoda arunoda deleted the preact-example branch January 1, 2017 01:24
@craigsssmith
Copy link
Contributor

I'm having a little difficulty using Preact with my next.js app.

Uncaught TypeError: Cannot set property createElement of #<Object> which has only a getter

I think the problem is related to React Hot Loader, with the error being thrown here: https://github.com/gaearon/react-hot-loader/blob/next/src/patch.dev.js#L166

Have you come across this before?

@developit
Copy link
Contributor

hmm - perhaps enable loose mode for the es2015 preset? It seems like this is tripping over frozen es2015 module exports.

@craigsssmith
Copy link
Contributor

That's exactly what I thought at first, but it doesn't make any difference. Apologies, I should have mentioned that I'd tried that already. :-)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants