Socket
Book a DemoInstallSign in
Socket

render-with-react17

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

render-with-react17

A simple util component to render components incompatible with React 18.x.

0.1.6
latest
Source
npmnpm
Version published
Weekly downloads
4
-63.64%
Maintainers
1
Weekly downloads
 
Created
Source

npm-version npm-download

render-with-react17

A simple util component to render components incompatible with React 18.x.

This library was created to facilitate the migration of applications to React 18, in case not all components that you use in your application (mainly external) already work with the new version of React.

Installation

To install the hook you can use npm:

npm i render-with-react17

or Yarn if you prefer:

yarn add render-with-react17

Usage

The first step is to import the component:

import { RenderWithReact17 } from 'render-with-react17';

Then move the rendering of the component that does not work inside the node RenderWithReact17.

const Component = () => (
  <RenderWithReact17>
    <NotWorkingComponent />
  </RenderWithReact17>
);

The important thing is to render in this way only the final component, which has no type dependency such as global state management - context, store, etc.

This means that passing state via the RenderWithReact17 component does not work at the moment. If a component inside RenderWithReact17 uses e.g. useContext - this will not work. Therefore it is important to use this library to render components which all data receives with props.

Keywords

react

FAQs

Package last updated on 12 Oct 2022

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.