Skip to content

Commit 426384b

Browse files
author
dphaener
committed
Remove private getConstructor function. Whoops
1 parent d7674a2 commit 426384b

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

lib/assets/javascripts/react_ujs_mount.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,6 @@
22
// jQuery is optional. Use it to support legacy browsers.
33
var $ = (typeof window.jQuery !== 'undefined') && window.jQuery;
44

5-
// Get the constructor for a className
6-
// Not a part of the public API
7-
function getConstructor(className) {
8-
// Assume className is simple and can be found at top-level (window).
9-
// Fallback to eval to handle cases like 'My.React.ComponentName'.
10-
// Also, try to gracefully import Babel 6 style default exports
11-
//
12-
var constructor;
13-
14-
// Try to access the class globally first
15-
constructor = window[className];
16-
17-
// If that didn't work, try eval
18-
if (!constructor) {
19-
constructor = eval.call(window, className);
20-
}
21-
22-
// Lastly, if there is a default attribute try that
23-
if (constructor && constructor.default) {
24-
constructor = constructor.default;
25-
}
26-
27-
return constructor;
28-
}
29-
305
window.ReactRailsUJS = {
316
// This attribute holds the name of component which should be mounted
327
// example: `data-react-class="MyApp.Items.EditForm"`

0 commit comments

Comments
 (0)