1
0
Fork 0
Commit graph

12 commits

Author SHA1 Message Date
Joost De Cock
bb901c4d8a fix(fs.dev): (hackish) workaround for theme prop update issue
This is a workaround for the following problem that I can't seem
to understand.

This JSX code:

<p data-theme={props.app.theme}>{props.app.theme}</p>

Is rendered as:

<p data-theme="light">dark</p>

This happens only upon initial page load because on the server
side we don't know the user's preferred theme. So we start with
the default (light).

Then, as the app bootstraps in the browser, it updated the content
of the P tag with the new theme (dark).
However, for reasons that I really don't understand, it does not
update the `data-theme` attribute.

So this works around that be forcing a different component for each
theme that has the data-theme hardcoded. By force-rendering a different
component, we can be certain React has no choice be to re-render the
entire tag.

If anybody could explain to me why this happen, I'd gladly buy you
a coffee or something.
2021-12-30 16:52:28 +01:00
Joost De Cock
1bc0b4985c wip(fs.dev): Troubleshooting SSR themeing issues 2021-12-30 14:23:02 +01:00
Joost De Cock
519de5e202 wip(fs.dev): More work on new dev site 2021-12-25 13:43:41 +01:00
Joost De Cock
096c2f5f6a wip(fs.dev): More work on new dev site 2021-12-24 18:17:02 +01:00
Joost De Cock
f59d4ed9fd wip(fs.dev): Theme changes and breadcrumbs fix 2021-12-22 17:06:50 +01:00
Joost De Cock
99393b8629 feat(fs.dev): MDX styling 2021-12-21 20:47:13 +01:00
Joost De Cock
18566b5d37 wip(fs.dev): Work on mdx components 2021-12-19 19:08:54 +01:00
Joost De Cock
ea46bc019d chore(fs.dev): Tweaks to dark theme 2021-12-18 15:48:01 +01:00
Joost De Cock
d1f53b78b6 feat(fs.dev): Added syntax highlighting 2021-12-18 15:41:37 +01:00
Joost De Cock
c5e971e8a7 feat(fs.dev): Loading MDX is now ok 2021-12-18 09:54:53 +01:00
Joost De Cock
e1ecd0cb98 feat(fs.dev): Added theme support 2021-12-11 14:04:05 +01:00
Joost De Cock
84ffe26a76 chore(fs.dev): Added daisyui 2021-12-10 14:22:52 +01:00