-
Notifications
You must be signed in to change notification settings - Fork 45
Is there a way to use this module with nextjs on a component level? #9
Comments
@HynekS see the other page in the example which takes in a dynamic |
Also note that you can totally render tweets entirely client-side. Pre-loading their AST on the server-side as part of the static props is an optimization. |
Thank you, Travis. I've seen the other page example, but it still depends on the But this is almost certainly not an issue of your module, but rather a limitation of Next.js. I will probably try my luck with the client side rendering. Also, using Sanity.io as a CMS, I could create a custom input, that would implement |
There are a few workarounds.
|
Thank you for the link to Guillermos blog, it helped me significantly. I realized I already have all the data I need in
Then, I can use Since this issue has nothing to do with your lib, but rather my lack of experience with Next.js, I am closing it. Thank you! |
Looks great. One suggestion would be to use https://github.com/sindresorhus/p-map instead of Promise.all since it allows you to control the concurrency. |
Is there a way to use this module with nextjs app, but not as a singular tweet page (as shown in demo), but as a nested component? Use case: blog post including one or multiple tweets, probably statically generated. I am currently using the twitter api and recreating the tweets from responses, but that is quite cumbersome (registration needed, CORS issues). I made an attempt to use the example code:
but I haven't found a way to pass the hardcoded
tweetId
variable as a dynamic argument ongetStaticProps
. Taking a look into nextjs docs, there is optionalcontext
parameter that can be used ingetStaticProps
, but it is limited to path params and a bunch of meta stuff. Is this currently possible considering the way getStaticProps works?The text was updated successfully, but these errors were encountered: