C# 클래스 React.ReactComponent

Represents a React JavaScript component.
상속: IReactComponent
파일 보기 프로젝트 열기: reactjs/React.NET 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_configuration IReactSiteConfiguration
_environment IReactEnvironment
_props object
_serializedProps string

공개 메소드들

메소드 설명
ReactComponent ( IReactEnvironment environment, IReactSiteConfiguration configuration, string componentName, string containerId ) : System

Initializes a new instance of the ReactComponent class.

RenderHtml ( bool renderContainerOnly = false, bool renderServerOnly = false ) : string

Renders the HTML for this component. This will execute the component server-side and return the rendered HTML.

RenderJavaScript ( ) : string

Renders the JavaScript required to initialise this component client-side. This will initialise the React component, which includes attach event handlers to the server-rendered HTML.

보호된 메소드들

메소드 설명
EnsureComponentExists ( ) : void

Ensures that this component exists in global scope

GetComponentInitialiser ( ) : string

Gets the JavaScript code to initialise the component

비공개 메소드들

메소드 설명
EnsureComponentNameValid ( string componentName ) : void

Validates that the specified component name is valid

GenerateId ( ) : string

Generates a unique identifier for this component, if one was not passed in.

메소드 상세

EnsureComponentExists() 보호된 메소드

Ensures that this component exists in global scope
protected EnsureComponentExists ( ) : void
리턴 void

GetComponentInitialiser() 보호된 메소드

Gets the JavaScript code to initialise the component
protected GetComponentInitialiser ( ) : string
리턴 string

ReactComponent() 공개 메소드

Initializes a new instance of the ReactComponent class.
public ReactComponent ( IReactEnvironment environment, IReactSiteConfiguration configuration, string componentName, string containerId ) : System
environment IReactEnvironment The environment.
configuration IReactSiteConfiguration Site-wide configuration.
componentName string Name of the component.
containerId string The ID of the container DIV for this component
리턴 System

RenderHtml() 공개 메소드

Renders the HTML for this component. This will execute the component server-side and return the rendered HTML.
public RenderHtml ( bool renderContainerOnly = false, bool renderServerOnly = false ) : string
renderContainerOnly bool Only renders component container. Used for client-side only rendering.
renderServerOnly bool Only renders the common HTML mark up and not any React specific data attributes. Used for server-side only rendering.
리턴 string

RenderJavaScript() 공개 메소드

Renders the JavaScript required to initialise this component client-side. This will initialise the React component, which includes attach event handlers to the server-rendered HTML.
public RenderJavaScript ( ) : string
리턴 string

프로퍼티 상세

_configuration 보호되어 있는 프로퍼티

Global site configuration
protected IReactSiteConfiguration _configuration
리턴 IReactSiteConfiguration

_environment 보호되어 있는 프로퍼티

Environment this component has been created in
protected IReactEnvironment _environment
리턴 IReactEnvironment

_props 보호되어 있는 프로퍼티

Raw props for this component
protected object _props
리턴 object

_serializedProps 보호되어 있는 프로퍼티

JSON serialized props for this component
protected string _serializedProps
리턴 string