/// <summary> /// Initialises a new instance of the <see cref="ReactRouterComponent"/> class. /// </summary> /// <param name="environment">The environment.</param> /// <param name="configuration">Site-wide configuration.</param> /// <param name="reactIdGenerator">React Id generator.</param> /// <param name="componentName">Name of the component.</param> /// <param name="containerId">The ID of the container DIV for this component</param> /// <param name="path">F.x. from Request.Path. Used by React Static Router to determine context and routing.</param> public ReactRouterComponent( IReactEnvironment environment, IReactSiteConfiguration configuration, IReactIdGenerator reactIdGenerator, string componentName, string containerId, string path ) : base(environment, configuration, reactIdGenerator, componentName, containerId) { _path = path; }
public ReactRouterComponent( ReactConfiguration configuration, IReactIdGenerator reactIdGenerator, IJavaScriptEngineFactory javaScriptEngineFactory, IComponentNameInvalidator componentNameInvalidator) : base( configuration, reactIdGenerator, javaScriptEngineFactory, componentNameInvalidator) { }
public ReactRouterComponent( ReactConfiguration configuration, IReactIdGenerator reactIdGenerator, INodeInvocationService _nodeInvocationService, IComponentNameInvalidator componentNameInvalidator) : base( configuration, reactIdGenerator, _nodeInvocationService, componentNameInvalidator) { }
protected ReactBaseComponent( ReactConfiguration configuration, IReactIdGenerator reactIdGenerator, INodeInvocationService nodeInvocationService, IComponentNameInvalidator componentNameInvalidator) { _configuration = configuration; _reactIdGenerator = reactIdGenerator; _componentNameInvalidator = componentNameInvalidator; _nodeInvocationService = nodeInvocationService; ExceptionHandler = _configuration.ExceptionHandler; }
protected ReactBaseComponent( ReactConfiguration configuration, IReactIdGenerator reactIdGenerator, IJavaScriptEngineFactory javaScriptEngineFactory, IComponentNameInvalidator componentNameInvalidator) { _configuration = configuration; _reactIdGenerator = reactIdGenerator; _javaScriptEngineFactory = javaScriptEngineFactory; _componentNameInvalidator = componentNameInvalidator; ExceptionHandler = _configuration.ExceptionHandler; }
/// <summary> /// Initializes a new instance of the <see cref="ReactEnvironment"/> class. /// </summary> /// <param name="engineFactory">The JavaScript engine factory</param> /// <param name="config">The site-wide configuration</param> /// <param name="cache">The cache to use for JSX compilation</param> /// <param name="fileSystem">File system wrapper</param> /// <param name="fileCacheHash">Hash algorithm for file-based cache</param> /// <param name="reactIdGenerator">React ID generator</param> public ReactEnvironment( IJavaScriptEngineFactory engineFactory, IReactSiteConfiguration config, ICache cache, IFileSystem fileSystem, IFileCacheHash fileCacheHash, IReactIdGenerator reactIdGenerator ) { _engineFactory = engineFactory; _config = config; _cache = cache; _fileSystem = fileSystem; _fileCacheHash = fileCacheHash; _reactIdGenerator = reactIdGenerator; _babelTransformer = new Lazy <IBabel>(() => new Babel(this, _cache, _fileSystem, _fileCacheHash, _config) ); _engineFromPool = new Lazy <PooledJsEngine>(() => _engineFactory.GetEngine()); }
/// <summary> /// Initializes a new instance of the <see cref="ReactComponent"/> class. /// </summary> /// <param name="environment">The environment.</param> /// <param name="configuration">Site-wide configuration.</param> /// <param name="reactIdGenerator">React Id generator.</param> /// <param name="componentName">Name of the component.</param> /// <param name="containerId">The ID of the container DIV for this component</param> public ReactComponent(IReactEnvironment environment, IReactSiteConfiguration configuration, IReactIdGenerator reactIdGenerator, string componentName, string containerId) { EnsureComponentNameValid(componentName); _environment = environment; _configuration = configuration; ComponentName = componentName; ContainerId = string.IsNullOrEmpty(containerId) ? reactIdGenerator.Generate() : containerId; ContainerTag = "div"; }