Skip to content

What is the performance cost? #5

@trusktr

Description

@trusktr

Hello! This is really neat!

I see the custom renderer does this:

export function render( Component ){
writeFileSync( './resources/index.gui', ReactDOMServer.renderToStaticMarkup( <Component /> ) );
}

What are the downsides?

  • How much slower is it to create UI dynamically by writing it to a file?
  • Does this mean React component can not use features like useRef or createRef to reference elements?

I do see the upsides though! This is definitely a nice way to compose markup, even if the dynamic element reference ability is missing.

I wonder: maybe there's an additional way we can "hydrate" the components, so that after they are loaded, document querying APIs could be used in order to make useRef or createRef work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions