Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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).

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
186
decreased by-39.02%
Maintainers
1
Weekly downloads
 
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

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc