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
17
votes
3 answers

React list rendering wrong data after deleting item

I have a simple list of student objects with name and their scores in state. Their name is bound to {student.name} and their score is bound to Whenever I want to delete the first student from…
manas
  • 6,119
  • 10
  • 45
  • 56
17
votes
3 answers

React DnD: Avoid using findDOMNode

I don't fully understand it but apparently it isn't recommended to use findDOMNode(). I'm trying to create drag and drop component but I'm not sure how I should access refs from the component variable. This is an example of what I currently…
joshhunt
  • 5,197
  • 4
  • 37
  • 60
16
votes
4 answers

Next.JS implement external ".js" with