Skip to content

Commit 78b5048

Browse files
committed
Merge pull request facebook#4853 from zpao/jsfiddle-babel
[docs] Add jsfiddle integration for Babel
2 parents 4b6e5d0 + 4a45ad3 commit 78b5048

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(function() {
2+
var tag = document.querySelector(
3+
'script[type="application/javascript;version=1.7"]'
4+
);
5+
if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
6+
alert('Bad JSFiddle configuration, please fork the original React JSFiddle');
7+
}
8+
tag.setAttribute('type', 'text/babel');
9+
tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');
10+
})();

0 commit comments

Comments
 (0)