
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
react-select2-wrapper
Advanced tools
Wrapper for Select2
npm install react-select2-wrapper --save
import Select2 from 'react-select2-wrapper';
…
<Select2
multiple
data={['bug', 'feature', 'documents', 'discussion']}
options={
{
placeholder: 'search by tags',
}
}
/>
<Select2
data={[
{ text: 'bug', id: 1 },
{ text: 'feature', id: 2 },
{ text: 'documents', id: 3 },
{ text: 'discussion', id: 4 },
]}
options={{
placeholder: 'search by tags',
}}
/>
<Select2
multiple
data={['bug', 'feature', 'documents', 'discussion']}
onOpen={this.cbOpen}
onClose={this.cbClose}
onSelect={this.cbSelect}
onChange={this.cbChange}
onUnselect={this.cbUnselect}
options={{
placeholder: 'search by tags',
}
}
/>
<Select2
defaultValue={2} // or as string | array
data={[
{ text: 'bug', id: 1 },
{ text: 'feature', id: 2 },
{ text: 'documents', id: 3, disabled: true },
{ text: 'discussion', id: 4 },
]}
options={{
placeholder: 'search by tags',
}}
/>
<Select2
multiple
defaultValue={[1, 4]}
data={[
{ text: 'bug', id: 1 },
{ text: 'feature', id: 2 },
{ text: 'documents', id: 3 },
{ text: 'discussion', id: 4 },
]}
options={{
placeholder: 'search by tags',
}}
/>
Also possible to change the current value using value
property
const { value } = this.props;
…
<Select2
value={ value }
data={[
{ text: 'bug', id: 1 },
{ text: 'feature', id: 2 },
{ text: 'documents', id: 3, disabled: true },
{ text: 'discussion', id: 4 },
]}
options={{
placeholder: 'search by tags',
}}
/>
<Select2
multiple
data={[
{ text: 'Development',
children: [
{ text: 'bug', id: 1 },
{ text: 'feature', id: 2 },
],
},
{ text: 'documents', id: 3 },
{ text: 'discussion', id: 4 },
]}
options={{
placeholder: 'search by tags',
}}
/>
<Select2
options={{
dropdownParent: '#element'
…
You can pass any properties such as class
, id
, data-*
attributes
<Select2 className="selector" … />
You can access to select2 as follows
// assign a ref attribute
<Select2 ref="tags" />
// somewhere in your code, access via `this.refs`
this.refs.tags.el
Default theme in css/select2.css
import 'react-select2-wrapper/css/select2.css';
Run webpack-dev-server
npm run start
Run webpack in watch mode
npm run watch
Run webpack for build
npm run build
FAQs
React component for Select2
The npm package react-select2-wrapper receives a total of 9,381 weekly downloads. As such, react-select2-wrapper popularity was classified as popular.
We found that react-select2-wrapper 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.