react-i13n
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -15,5 +15,8 @@ /* global process */ | ||
* @param {Object|String} Component the component you want to create a i13nNode | ||
* @param {Object} defaultProps default props | ||
* @param {Object} options | ||
* @param {Object} options.displayName | ||
* @method createI13nNode | ||
*/ | ||
module.exports = function createI13nNode (Component, options) { | ||
module.exports = function createI13nNode (Component, defaultProps, options) { | ||
if (!Component) { | ||
@@ -27,6 +30,7 @@ if ('production' !== process.env.NODE_ENV) { | ||
var componentName = Component.displayName || Component.name || Component; | ||
defaultProps = defaultProps || {}; | ||
options = options || {}; | ||
var I13nComponent = React.createClass({ | ||
displayName: 'I13n' + componentName, | ||
displayName: options.displayName || ('I13n' + componentName), | ||
mixins: [I13nMixin], | ||
@@ -48,3 +52,3 @@ autobind: false, | ||
scanLinks: null | ||
}, options); | ||
}, defaultProps); | ||
}, | ||
@@ -51,0 +55,0 @@ |
@@ -18,2 +18,3 @@ /** | ||
* @param {Object} options.i13nNodeClass the i13nNode class, you can inherit it with your own functionalities | ||
* @param {Object} options.displayName display name of the wrapper component | ||
* @param {Array} plugins plugins | ||
@@ -23,2 +24,4 @@ * @method setupI13n | ||
module.exports = function setupI13n (Component, options, plugins) { | ||
options = options || {}; | ||
plugins = plugins || []; | ||
var RootI13nComponent; | ||
@@ -36,3 +39,3 @@ var componentName = Component.displayName || Component.name; | ||
displayName: 'RootI13n' + componentName, | ||
displayName: options.displayName || ('RootI13n' + componentName), | ||
@@ -39,0 +42,0 @@ autobind: false, |
{ | ||
"name": "react-i13n", | ||
"description": "React I13n provides a performant and scalable solution to application instrumentation.", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
74208
1761