The react-dom/server package allows you to render your components on the server.
Questions tagged [react-dom-server]
74 questions
0
votes
1 answer
JavaScript function calls are not working inside table dropdown when ReactDOMServer and innerHTML are used
JavaScript functions calls are not working inside the table dropdown which is added to the DOM by innerHTML
employeesRetrieval = e => {
axios.post('http://localhost:5000/employeesRetrieval')
.then( res => {
let…

Guna Chand Dakavarapu
- 41
- 2
- 11
0
votes
1 answer
JavaScript: How to format a str.replace with ReactDOMServer.renderToString, using a captured element as a prop
I am trying to apply this regex
str.replace(/(.*?)<\/L>/g, ReactDOMServer.renderToString($1 ))
But it doesn't recognize the $1 that is in the href={$1} (says it is not defined), while it does appear in the second place…

GWorking
- 4,011
- 10
- 49
- 90
0
votes
1 answer
How does ReactDOMServer behave when code needs the device width?
I have the following hook that I use to build responsive components throughout my App.
I looking into implementing Server Side Rendering.
useWindowWidth.js
import {useEffect, useRef, useState} from 'react';
function useWindowWidth() {
const…

cbdeveloper
- 27,898
- 37
- 155
- 336
0
votes
2 answers
Vue bind without colon or shorthand
Vue has any way to don't use the shorthand or colon? this is not valid html and I have problems implementing it with React-Dom for server rendering in Node.js

Cami Rodriguez
- 1,057
- 4
- 14
- 30
0
votes
1 answer
Node try/catch block still bubbles up
I'm having issues catching my server-rendering errors, the odd this for me is that it reaches the catch statement however it still bubbles up and crashes & gets Uncaught exception.
Here is a stripped version of my function:
export default…

Joelgullander
- 1,624
- 2
- 20
- 46
0
votes
1 answer
Uncaught ReferenceError: ReactDOMServer is not defined
Hello everyone I work on a Java Web project using react and jquery to render dynamic web pages. So I wanted to use the function ReactDOMServer.renderToStaticMarkup (element) to retrieve the html nodes related to the html element but I receive as an…

Wambert Orion
- 399
- 3
- 14
0
votes
1 answer
How to disable ReactDOMServer.renderToStaticMarkup from inlining small images?
My React app is currently using ReactDOMServer.renderToStaticMarkup to generate HTML emails.
The problem I'm having with ReactDOMServer.renderToStaticMarkup is that it converts small images (under 12kb) from a image src URL to an inline image. This…

AnApprentice
- 108,152
- 195
- 629
- 1,012
0
votes
1 answer
Invariant Violation: Error while using React-Dom renderToString() in es6 importing
This question is quite different as I searched a lot for similar but didnt find any I am creating a project of react server side rendering feature and using webpack to write the es6 code and babel to compile the jsx . In my express route I want to…

Aniketh Saha
- 843
- 10
- 22
0
votes
1 answer
jsx passed to react-dom/server renderToString
I'm trying to understand react-dom/server.
I have a react application, using express as the server.
I have an express route like so :
var server = app.listen(3000);
app.get('/test', (req, res) => {
const context = {}
…

trogne
- 3,402
- 3
- 33
- 50
0
votes
1 answer
Syntax Error while using ReactDOMServer with Sass
Im getting Syntax Error like below while using ReactDOMServer and Sass in my project:
SyntaxError: /Users/ceyhun23/Sites/{project_name}/lib/components/common/Menu/Menu.scss: Unexpected character '#' (1:3)
0|server | > 1 | img#logo{
0|server …

Jeyhun Ashurbayov
- 746
- 7
- 11
0
votes
2 answers
React Express TypeError: Cannot read property 'then' of undefined
I'm trying to render my react app on server incase the user has disabled javascript and also for better search result. But somewhere between export and using the function, I got the TypeError: Cannot read property 'then' of undefined error.
Here are…

Coffee
- 95
- 1
- 13
0
votes
1 answer
React-router multiple routes (React components)
Below are my routes.js that handles every request - this is for server side rendering in react - I have the following 2 files - I get hello world right now
The main issue I have is -
Where do i handle other routes? I am confused here this part -…

Sam kobby
- 1
- 2
0
votes
3 answers
simple server/client routing react-express(nodejs)
App.js has a link to - I am not understanding if I need action creators/reducers? if so how to wire it up with server side rendering?
Basically on load of otherComponent - should make an API call from server.js by path and inject response back to…

monkeyjs
- 604
- 2
- 7
- 29
0
votes
1 answer
Detect when a react-rendered image loads
I have a React component for rendering customized images. In a simplified form, it looks like this:
function MyImage(props) {
return
}
The webpage is server-rendered by ReactDOMServer and the
…

Peter Bašista
- 749
- 9
- 22