Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@kingstinct/react-decoration
Advanced tools
This is a simple fork of react-decoration without the perf decorator and without the react-addons-perf dependency to be fully compatible with React Native. An even better solution would be to use a performance library that works with React Native.
A collection of @decorators for React Components
Attention - In order to use react-decoration you have to use babel 5 or use this plugin for babel 6. Check this page for information.
You can install react-decoration using npm:
npm install --save react-decoration
If you aren't using npm in your project, you can include reactDecoration using UMD build in the dist folder with <script>
tag.
Once you have installed react-decoration, supposing a CommonJS environment, you can import decorators in this way and immediately use them with no configuration.
import React from 'react';
import { getItems } from './utils';
import { AutoComplete } from './components';
import {
withStyles,
debounce,
killEvent,
handleRenderError,
} from 'react-decoration';
@withStyles({
container: {
width: '100%',
height: 'auto',
},
input: {
width: 250,
},
})
@handleRenderError((ex) => <div className="danger">{ex.message}<div>)
class SampleForm extends React.Component {
state = {
value: 'Hello!',
items: [],
}
@debounce(500)
handleChange(e) {
getItems().then((response) => {
this.setState({
value: this.state.value,
items: response.data.items,
});
});
this.setState({
value: e.target.value,
items: this.state.items,
});
}
@killEvent
handleSubmit() {
// default prevented
// propagation stopped
alert(`AutoComplete value is: ${this.state.value}`);
}
render() {
const { styles } = this.props;
return (
<div style={styles.container}>
<AutoComplete
value={this.state.value}
items={this.state.items}
onChange={this.handleChange}
style={styles.input}
/>
<button onClick={this.handleSubmit}>
Submit
</button>
</div>
);
}
}
Visit docs folder to find the complete list of decorators and their usage.
This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented on the Github Releases page.
Matteo Basso
Copyright (c) 2016, Matteo Basso.
react-decoration source code is licensed under the MIT License.
FAQs
A collection of @decorators for React Components
The npm package @kingstinct/react-decoration receives a total of 1 weekly downloads. As such, @kingstinct/react-decoration popularity was classified as not popular.
We found that @kingstinct/react-decoration 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.