lingui-react
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -6,2 +6,18 @@ # Change Log | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/lingui/js-lingui/compare/lingui-react@1.2.1...lingui-react@1.3.0) (2017-10-02) | ||
### Bug Fixes | ||
* Fix default text rendering ([ccf7e45](https://github.com/lingui/js-lingui/commit/ccf7e45)) | ||
### Features | ||
* Render translation as a text only ([519d450](https://github.com/lingui/js-lingui/commit/519d450)) | ||
<a name="1.2.1"></a> | ||
@@ -8,0 +24,0 @@ ## [1.2.1](https://github.com/lingui/js-lingui/compare/lingui-react@1.2.0...lingui-react@1.2.1) (2017-09-12) |
@@ -32,6 +32,12 @@ import { date, number } from 'lingui-formats'; | ||
var render = this.props.render || this.context.linguiDefaultRender || 'span'; | ||
var render = this.props.render !== undefined ? this.props.render : this.context.linguiDefaultRender; | ||
// Built-in element: h1, p | ||
if (typeof render === 'string') { | ||
if (render === undefined) { | ||
render = 'span'; | ||
} | ||
if (render === null) { | ||
return value; | ||
} else if (typeof render === 'string') { | ||
// Built-in element: h1, p | ||
return React.createElement(render, { className: className }, value); | ||
@@ -143,3 +149,4 @@ } | ||
return React.createElement(WrappedComponent, _extends({ ref: this.setWrappedInstance }, this.props, { i18n: i18n })); | ||
var props = _extends({}, this.props, withRef ? { ref: this.setWrappedInstance } : {}); | ||
return React.createElement(WrappedComponent, _extends({}, props, { i18n: i18n })); | ||
} | ||
@@ -146,0 +153,0 @@ }]); |
@@ -39,6 +39,12 @@ 'use strict'; | ||
var render = this.props.render || this.context.linguiDefaultRender || 'span'; | ||
var render = this.props.render !== undefined ? this.props.render : this.context.linguiDefaultRender; | ||
// Built-in element: h1, p | ||
if (typeof render === 'string') { | ||
if (render === undefined) { | ||
render = 'span'; | ||
} | ||
if (render === null) { | ||
return value; | ||
} else if (typeof render === 'string') { | ||
// Built-in element: h1, p | ||
return React__default.createElement(render, { className: className }, value); | ||
@@ -150,3 +156,4 @@ } | ||
return React__default.createElement(WrappedComponent, _extends({ ref: this.setWrappedInstance }, this.props, { i18n: i18n })); | ||
var props = _extends({}, this.props, withRef ? { ref: this.setWrappedInstance } : {}); | ||
return React__default.createElement(WrappedComponent, _extends({}, props, { i18n: i18n })); | ||
} | ||
@@ -153,0 +160,0 @@ }]); |
{ | ||
"name": "lingui-react", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "React components for translations", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"react": "15.x || ^16.0.0-alpha" | ||
"react": "^15.0.0" | ||
}, | ||
@@ -39,4 +39,4 @@ "engines": { | ||
"lingui-formats": "^1.0.3", | ||
"lingui-i18n": "^1.3.0", | ||
"prop-types": "^15.5.10" | ||
"lingui-i18n": "^1.3.1", | ||
"prop-types": "^15.6.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "scripts": { |
@@ -28,5 +28,5 @@ [![License][Badge-License]][License] | ||
[jsLingui]: https://github.com/lingui/js-lingui | ||
[Documentation]: https://lingui.gitbooks.io/js/ | ||
[Tutorial]: https://lingui.gitbooks.io/js/tutorials/react.html | ||
[Reference]: https://lingui.gitbooks.io/js/ref/react.html | ||
[Documentation]: https://lingui.github.io/js-lingui/ | ||
[Tutorial]: https://lingui.github.io/js-lingui/tutorials/react.html | ||
[Reference]: https://lingui.github.io/js-lingui/ref/react.html | ||
[Package]: https://www.npmjs.com/package/lingui-react | ||
@@ -33,0 +33,0 @@ [Badge-Downloads]: https://img.shields.io/npm/dw/lingui-react.svg |
Sorry, the diff of this file is not supported yet
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
52544
888
+ Addedasap@2.0.6(transitive)
+ Addedcore-js@1.2.7(transitive)
+ Addedcreate-react-class@15.7.0(transitive)
+ Addedencoding@0.1.13(transitive)
+ Addedfbjs@0.8.18(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisomorphic-fetch@2.2.1(transitive)
+ Addednode-fetch@1.7.3(transitive)
+ Addedpromise@7.3.1(transitive)
+ Addedreact@15.7.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedua-parser-js@0.7.39(transitive)
+ Addedwhatwg-fetch@3.6.20(transitive)
- Removedreact@16.14.0(transitive)
Updatedlingui-i18n@^1.3.1
Updatedprop-types@^15.6.0