
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-advanced-loader
Advanced tools
React higher-order component that prevents a wrapped component from rendering until specified conditions are met, i.e., an API response is received or some prop is updated. Displays selected animated spinner from react-spinkit collection while loading.
React higher-order component that prevents a wrapped component from rendering until specified conditions are met, i.e., an API response is received or some prop is updated. Displays selected animated spinner from better-react-spinkit collection while loading.
Can be used as a higher-order component or as an ES7 class decorator (see examples)
npm install react-advanced-loader--save-dev
// Using ES7 Decorators
import React, { PropTypes } from 'react'
import AdvancedLoader from 'react-advanced-loader'
@AdvancedLoader({
prepare: (props) => props.loadAPIData(),
isReady: (props) => props.isLoaded
})
export default class MyComponent extends React.Component {
static propTypes = {
loadAPIData: PropTypes.func.isRequired,
isLoaded: PropTypes.bool.isRequired
}
render() (
<div>Component loaded!</div>
)
}
// ES2015
import React, { PropTypes } from 'react'
import AdvancedLoader from 'react-advanced-loader'
class MyComponent extends React.Component {
static propTypes = {
loadAPIData: PropTypes.func.isRequired,
isLoaded: PropTypes.bool.isRequired
}
render() (
<div>Component loaded!</div>
)
}
export default AdvancedLoader({
prepare: (props) => props.loadAPIData(),
isReady: (props) => props.isLoaded
})(MyComponent) // Enhanced component
Parameters
prepare [function] A function that is passed props and contains loading logic that precedes component renderingisReady [function] A function that is passed props and returns true or false depends on specified conditions. Indicates whether a loading process has completed and a component can be displayed.refreshOnUpdate [array] An array that list all props that need to be watched in order to invoke preparation method againspinnerType [string] A string that indicates which spinner from better-react-spinkit should be used. Defaults to ThreeBounce.spinnerOptions [object] Full list of available options for specific spinner type can be found in here.spinnerOptions.color [string] A string that indicates what spinner color should bespinnerOptions.size [number] A number that set a size of the spinner, on a scale of 1 to 100. Defaults to 15.Returns the underlying wrapped component instance. Useful if you need to access a method or property of the component passed to react-advanced-loader.
Returns object The wrapped React component instance
This project is licensed under the MIT License.
FAQs
React higher-order component that prevents a wrapped component from rendering until specified conditions are met, i.e., an API response is received or some prop is updated. Displays selected animated spinner from react-spinkit collection while loading.
We found that react-advanced-loader 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.