Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
react-lazily-render
Advanced tools
Changelog
1.2.0
scrollContainer
(#7)devDependencies
that had security issuesreact
as a peerDependency
module
field in package.json
Readme
Lazily render react components.
Delay mounting expensive components until a placeholder component has been scrolled into view.
npm install --save react-lazily-render
import React from 'react';
import LazilyRender from 'react-lazily-render';
<div>
...lots of content...
<LazilyRender
placeholder={<PlaceholderComponent/>}
content={<ExpensiveComponent/>}
/>
...lots of content...
<LazilyRender>
{render => render
? <ExpensiveComponent/>
: <PlaceholderComponent/>
}
</LazilyRender>
...lots of content...
</div>
string
The className
applied to the wrapping element.
string | React.ComponentClass
The wrapping component.
e.g.
<LazilyRender component="span"/>
<LazilyRender component={MyComponent}/>
number | {top?: number, right?: number, bottom?: number, left?: number}
An offset applied to the element for calculating whether the component has been scrolled into view.
You can specify individual values for each side, or a single value used for all sides.
React.Node
Rendered when the component hasn't been scrolled into view.
React.Node
Rendered when the component has been scrolled into view.
(render: boolean) => React.Node
Called to render something depending on whether the component has been scrolled into view.
() => void
Called when the component becomes visible for the first time.
HTMLElement | undefined
The container which react-lazily-render
listens to for scroll events.
This property can be used in a scenario where you want to specify your own scroll container - e.g. if the component you are rendering is asynchronously added to the DOM.
FAQs
Lazily render react components
The npm package react-lazily-render receives a total of 7,806 weekly downloads. As such, react-lazily-render popularity was classified as popular.
We found that react-lazily-render demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.