0

I am learning React by React Quickly, Azat Mardan that uses React v15.5.4. All examples contain two files react.js and react-dom.js, for example hello-js-world-jsx. I would like to use the latest React version that is v17.0.1 and this version does not have these files.

  1. What files should I use from v17.0.1 to make hello-js-world-jsx example working?

  2. The second issue is that v17.0.1 does not have ReactDOM.render. I am getting something like

    Uncaught ReferenceError: ReactDOM is not defined

Please note, I do not want use npm modules only whose files.

Thank you for you support!

0

1 Answer 1

1

According an official docs: you need links for development mode:

 <script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
 <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>

https://reactjs.org/docs/cdn-links.html

For properly props rename 'frameworkName' to lowercase 'frameworkname'

class HelloWorld extends React.Component {
  render() {
    return React.createElement(
      'h1',
      this.props,
      'Hello ',
      this.props.frameworkname,
      ' world!!!'
    );
  }
}

ReactDOM.render(React.createElement(
  'div',
  null,
  React.createElement(HelloWorld, {
    id: 'ember',
    frameworkname: 'Ember.js',
    title: 'A framework for creating ambitious web applications.' }),
  React.createElement(HelloWorld, {
    id: 'backbone',
    frameworkname: 'Backbone.js',
    title: 'Backbone.js gives structure to web applications...' }),
  React.createElement(HelloWorld, {
    id: 'angular',
    frameworkname: 'Angular.js',
    title: 'Superheroic JavaScript MVW Framework' })
), document.getElementById('content')); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.