Comparing version 0.9.0-alpha.3 to 0.9.0-alpha.4
@@ -328,7 +328,11 @@ import { object } from 'prop-types'; | ||
var Field = function (_a, context) { | ||
var component = _a.component, name = _a.name, props = __rest(_a, ["component", "name"]); | ||
if (component) { | ||
return createElement(component, __assign({}, props, { name: name }, context.formik)); | ||
} | ||
return createElement('input', __assign({}, props, { name: name, value: context.formik.values[name], onChange: context.formik.handleChange, onBlur: context.formik.handleBlur })); | ||
var _b = _a.component, component = _b === void 0 ? 'input' : _b, name = _a.name, props = __rest(_a, ["component", "name"]); | ||
var bag = typeof component === 'string' | ||
? { | ||
value: context.formik.values[name], | ||
onChange: context.formik.handleChange, | ||
onBlur: context.formik.handleBlur, | ||
} | ||
: context.formik; | ||
return createElement(component, __assign({}, props, { name: name }, bag)); | ||
}; | ||
@@ -335,0 +339,0 @@ Field.contextTypes = { |
@@ -330,7 +330,11 @@ 'use strict'; | ||
var Field = function (_a, context) { | ||
var component = _a.component, name = _a.name, props = __rest(_a, ["component", "name"]); | ||
if (component) { | ||
return React.createElement(component, __assign({}, props, { name: name }, context.formik)); | ||
} | ||
return React.createElement('input', __assign({}, props, { name: name, value: context.formik.values[name], onChange: context.formik.handleChange, onBlur: context.formik.handleBlur })); | ||
var _b = _a.component, component = _b === void 0 ? 'input' : _b, name = _a.name, props = __rest(_a, ["component", "name"]); | ||
var bag = typeof component === 'string' | ||
? { | ||
value: context.formik.values[name], | ||
onChange: context.formik.handleChange, | ||
onBlur: context.formik.handleBlur, | ||
} | ||
: context.formik; | ||
return React.createElement(component, __assign({}, props, { name: name }, bag)); | ||
}; | ||
@@ -337,0 +341,0 @@ Field.contextTypes = { |
{ | ||
"name": "formik", | ||
"description": "Forms in React, without tears", | ||
"version": "0.9.0-alpha.3", | ||
"version": "0.9.0-alpha.4", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": "Jared Palmer <jared@palmer.net>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
367864
2169