/// <summary> /// Loads standard React and JSXTransformer scripts into the engine. /// </summary> protected virtual void InitialiseEngine(IJsEngine engine) { var thisAssembly = typeof(ReactEnvironment).Assembly; engine.ExecuteResource("React.Resources.shims.js", thisAssembly); engine.ExecuteResource("React.Resources.react-with-addons.js", thisAssembly); engine.Execute("var React = global.React"); // Only load JSX Transformer if engine supports it if (engine.SupportsJsxTransformer()) { engine.ExecuteResource("React.Resources.JSXTransformer.js", thisAssembly); } }
/// <summary> /// Loads standard React and JSXTransformer scripts into the engine. /// </summary> private void InitialiseEngine(IJsEngine engine) { var thisAssembly = GetType().Assembly; engine.ExecuteResource("React.Resources.shims.js", thisAssembly); engine.ExecuteResource("React.Resources.react-with-addons.js", thisAssembly); engine.Execute("var React = global.React"); // Only load JSX Transformer if engine supports it if (engine.SupportsJsxTransformer()) { engine.ExecuteResource("React.Resources.JSXTransformer.js", thisAssembly); } }