Parcel + React + Dynamic HTML meta properties - is it possible? #8365
Replies: 2 comments
-
I've got the same issue...would be keen to hear if anyone has a suitable solution! |
Beta Was this translation helpful? Give feedback.
-
Parcel doesn't do SSG/SSR/..., so from Parcel's perspective, there is no difference between a page without routing and a React SPA with a client side router. The only SPA specific feature is that the dev server returns the index page on 404, which makes client routing work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Originally I was intent to ask about dynamic rendering with Parcel but then I thought my question has to be more generic.
So, what we're trying to achieve is to let social medias / messengers creating a previews with dynamically set images (for instance, first photo on this page). The problem is, we use React which is SPA which means we don't have a page for each of the product so we have to do that dynamically. Which, of course, not going to work out of the box as crawlers don't run any js.
We found this solution but it assumes using Express and run index script which would return index.html
Now, according to Parcel 2 documentations we run Parcel apps like this:
parcel index.html
and the page contains index script in it. So, page goes first then there is a script that, as Express starter script, is supposed to retrun index,html! Sounds like a really, really bad idea to me.So, the question is, with such combination, is it possible to have dynamic meta properties at all?
In case it's related, we host on Netify.
Beta Was this translation helpful? Give feedback.
All reactions