Socket
Book a DemoInstallSign in
Socket

@midudev/react-static-content

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@midudev/react-static-content

Server Side Rendering for a component and skip the hydration step on the client. Useful for components that don't need to use interactivity (like SEO links).

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Static Content 📸

Server Side Rendering for a component and skip the hydration step on the client. Useful for components that don't need to use interactivity (like SEO links).

Results of using it

Benefits... 👍

  • ⚡ Avoid re-hydrate for static components
  • 🤳 Thus could greatly improve TTI

Downsides... 👎

  • ⚠️ Lose interactivity
  • 🏋️‍ Hydration data still there
  • 🥪 Element wrapper (ex.
    )

Keep in mind... 🧠

  • 📸 For expensive rendering lists or static content (SEO Footers)
  • 🤖 GoogleBot is definitely going to detect it

## How to use 👨‍🏫 Just wrap the components you want to be static on the client.

import StaticContent from '@midudev/react-static-content'

export default function SeoFooter({listOfLinks}) {
  return (
    <footer>
      <StaticContent>
        {listOfLinks.map((link, idx) => (
            <a key={idx} href={link.href} title={link.literal} />
                <span>{link.literal}</span>
            </a>
        ))}
      </StaticContent>
    </footer>
  )
}

Resources 🔗

Tweet about suppressHydrationWarning suppressHydrationWarning Pull Request Hack for avoiding hydration

Keywords

react

FAQs

Package last updated on 29 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.