Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-radio-group

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-radio-group - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

.idea/.name

37

lib/index.js
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define("RadioGroup", ["exports", "module", "react"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, require("react"));
if (typeof define === 'function' && define.amd) {
define('RadioGroup', ['exports', 'module', 'react'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module, require('react'));
} else {

@@ -14,7 +14,7 @@ var mod = {

})(this, function (exports, module, _react) {
"use strict";
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -24,9 +24,16 @@ var _React = _interopRequireDefault(_react);

function radio(name, selectedValue, onChange) {
return _React["default"].createClass({
return _React['default'].createClass({
render: function render() {
return _React["default"].createElement("input", _extends({}, this.props, {
type: "radio",
name: name,
checked: this.props.value === selectedValue,
onChange: onChange.bind(null, this.props.value) }));
var optional = {};
if (selectedValue !== undefined) {
optional.checked = this.props.value === selectedValue;
}
if (typeof onChange === 'function') {
optional.onChange = onChange.bind(null, this.props.value);
}
return _React['default'].createElement('input', _extends({}, this.props, {
type: 'radio',
name: name
}, optional));
}

@@ -36,4 +43,4 @@ });

module.exports = _React["default"].createClass({
displayName: "index",
module.exports = _React['default'].createClass({
displayName: 'index',

@@ -55,5 +62,5 @@ propTypes: {

var renderedChildren = children(radio(name, selectedValue, onChange));
return renderedChildren && _React["default"].Children.only(renderedChildren);
return renderedChildren && _React['default'].Children.only(renderedChildren);
}
});
});
{
"name": "react-radio-group",
"version": "2.1.1",
"version": "2.2.0",
"description": "Better radio buttons.",

@@ -30,7 +30,9 @@ "main": "index.js",

"author": "chenglou <chenglou92@gmail.com>",
"contributors": [{
"name": "Jamison Dance",
"email": "jergason@gmail.com",
"url": "http://jamisondance.com"
}],
"contributors": [
{
"name": "Jamison Dance",
"email": "jergason@gmail.com",
"url": "http://jamisondance.com"
}
],
"license": "MIT",

@@ -37,0 +39,0 @@ "bugs": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc