Questions tagged [react-dom]

React package for working with the DOM.

npm install react react-dom

This package serves as the entry point of the DOM-related rendering paths. It is intended to be paired with the isomorphic React, which will be shipped as react to npm.

Usage

In the browser

var React = require('react');
var ReactDOM = require('react-dom');
 
class MyComponent extends React.Component {
  render() {
    return <div>Hello World</div>;
  }
}
 
ReactDOM.render(<MyComponent />, node);

On the server

var React = require('react');
var ReactDOMServer = require('react-dom/server');
 
class MyComponent extends React.Component {
  render() {
    return <div>Hello World</div>;
  }
}
 
ReactDOMServer.renderToString(<MyComponent />);
1131 questions
-1
votes
2 answers

Intellij 2016.1.4 and React render() method

I have a render method inside React component: import * as React from "react"; import MediaService from "./service/MediaService"; import ComponentLifecycle = require("@types/react"); import DOMHelper from "../helpers/DOMHelper"; export default…
-1
votes
1 answer

ReactDOM.render does not update containers props

I have a container containing some html with a
. I have a react stateful component that I want to render in that div using React.render(, document.getElementById('ID')) When I call an…
Piyush
  • 3,015
  • 3
  • 18
  • 31
-1
votes
1 answer

Installed react dom rather than react-dom. What's the difference?

kind of new at this and typed in "install react dom" instead of "install react-dom" in my command prompt. What exactly is the difference and what did I install?
Jared
  • 11
-1
votes
1 answer

Reactjs not rerendering for component array

This is a question more about the general way that reactjs handles rerendering and how components in arrays work. So I have a function that creates an array of components but the users props is empty if I do it as follows: // General look of the…
A. L
  • 11,695
  • 23
  • 85
  • 163
-2
votes
1 answer

React does not recognize the `isActive` prop on a DOM element

I'm using an isActive property in React. It's not a native property but I would like to use it to make sense in my code logic. However, React is displaying this warning: StyledComponent.ts:159 styled-components: it looks like an unknown prop…
-2
votes
3 answers

I test a website in react and my functions are not showing when I run my code

` function bannner() { const title = "c'est pur " return (

{title}

) } function cart() { const prixbedo = 10 const prixhero = 20 const prixcoc = 70 return (

Panier

-2
votes
1 answer

React Testing Library: Testing an API call on button click

I'm writing tests for a React component Order that renders a user's order and allows the user to view items on the order by clicking on a "View items" button, which triggers an API call. import { useState, useEffect } from "react"; import Skeleton…
-2
votes
1 answer

how to render or create new elements in react js

so i am trying to make a program where i can make or create new elements in react js on a click i tried few things but it gives me few errors import React from 'react' import { ReactDOM } from 'react' export default class Create extends…
-2
votes
1 answer

Survey JS used in React App using version 17.0.1?

I am trying to implement the Survey Creator from Survey JS in my React App. I am a new developer so could you explain how I fix this? I'm currently using Material UI in my app. If I switch to version 16.5.0 of react and react-dom, then material UI…
-2
votes
3 answers

How to use react-draggable for modal using ant-design?

I decided to use the react-draggable npm package for my modal window using ant-design, (for those who don't know react-draggable, this is a simple component for making elements draggable). But I am having difficulty, I tried to wrap my modal window…
Synchro
  • 1,105
  • 3
  • 14
  • 44
-2
votes
1 answer

How to use navigation on react, which will work both web and mobile?

I am not able to load the @react-navigation/web, In React-navigation 5x. It is removed, then how to implement.
-2
votes
2 answers

Uncaught SyntaxError: Unexpected token '<'

when i run this code in google chrome it dose not work it is just a blank page "REACT EXAMPLE">
Abu ali
  • 19
  • 2
-2
votes
1 answer

How would I render to two different grids in reactjs?

I want to render to colLeft and ColRight from the same ReactJs class. So that one component goes to the left and one to the right.
sander
  • 1,426
  • 4
  • 19
  • 46
-3
votes
2 answers

How do i fix it?

src\components\Messages\Messages.tsx Line 180:114: Parsing error: ',' expected ERROR in src/components/Messages/Messages.tsx:14:23 TS7016: Could not find a declaration file for module 'dompurify'.…
-3
votes
1 answer

i dont know why click event is not firing.can anyone help me please

enter image description here can anyone solve thisenter image description here
1 2 3
75
76