Skip to content

Commit 6553005

Browse files
author
Eduardo García Sanz
committed
fixing a little bug...
1 parent c53f5f9 commit 6553005

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var isSVG = function (filename) {
2222

2323
var wrapScript = function (filename, data) {
2424

25-
return 'module.exports = require("react").createClass({render: function () { return (' + data + '); }});';
25+
return 'var React = require("react");module.exports = React.createClass({render: function () { return (' + data + '); }});';
2626
};
2727

2828
var wrapSpan = function (filename, data) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"homepage" : "https://github.com/coma/svg-reactify",
55
"repository" : "https://github.com/coma/svg-reactify",
66
"main" : "./index.js",
7-
"version" : "0.5.0",
7+
"version" : "0.5.1",
88
"license" : "MIT",
99
"private" : false,
1010
"authors" : [

test/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('when passing a string', function () {
4141
return;
4242
}
4343

44-
assert.strictEqual(output, 'module.exports = require("react").createClass({render: function () { return (React.createElement("svg", {viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg"}, React.createElement("path", {d: "M0 0h100v100H0z"}))); }});');
44+
assert.strictEqual(output, 'var React = require("react");module.exports = React.createClass({displayName: "exports",render: function () { return (React.createElement("svg", {viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg"}, React.createElement("path", {d: "M0 0h100v100H0z"}))); }});');
4545
done();
4646
}
4747
};
@@ -71,7 +71,7 @@ describe('when passing a string', function () {
7171
return;
7272
}
7373

74-
assert.strictEqual(output, 'module.exports = require("react").createClass({render: function () { return (React.createElement("span", {class: "icon icon-foo"}, React.createElement("svg", {viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg"}, React.createElement("path", {d: "M0 0h100v100H0z"})))); }});');
74+
assert.strictEqual(output, 'var React = require("react");module.exports = React.createClass({displayName: "exports",render: function () { return (React.createElement("span", {class: "icon icon-foo"}, React.createElement("svg", {viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg"}, React.createElement("path", {d: "M0 0h100v100H0z"})))); }});');
7575
done();
7676
}
7777
};

0 commit comments

Comments
 (0)