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?
Hello! This is really neat!
I see the custom renderer does this:
fitbit-react/views/tools.js
Lines 5 to 7 in 7852fdc
What are the downsides?
useReforcreateRefto 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,
documentquerying APIs could be used in order to makeuseReforcreateRefwork?