Thinking about accessibility and crawlers, let's say I have a dynamic component that updates every second.
<LiveComponent />
output:
<div id="live">
<!-- Something that changes very frequently -->
</div>
However, if someone has a screen reader, or if a bot crawls it, the constantly updating component won't be very helpful. I'd rather show something like a snapshot, summary, or alternative piece of information on that very first paint that bots will grab, and screenreaders will process, but won't be visible to the user. (Prefer to not have a flash of refresh.):
<div id="live">
<p>This is a static version of the dynamic data that's just as informative</p>
</div>
Possible options:
useEffect(()=>{ }, []);tied to a display class... but hiding / revealing elements with CSS will clutter things up (both bits of info will be seen by bots / readers)- Conditional-rendering: won't work (I think) because I need this to be client side...