score:7
Accepted answer
your code is fine, you are using a really old version of babel-standalone
though.
// this
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.4.4/babel.min.js"></script>
// should be this
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.17.0/babel.min.js"></script>
and
<script type="text/babel" src="components.js"></script>
// should be
<script type="text/babel" src="components.js" data-presets="es2015,react"></script>
Source: stackoverflow.com
Related Query
- Single React Component rendering with Babel Standalone with only index.html and Component
- React js : Rendering multiple index html in a single page applications
- React isomorphic component with both client-side and server-side rendering
- Unable to expose a component library in react with webpack and babel
- React: Adding props only to React component and not html tag (React.Children.map recursively)
- Embed a single react component created with create-react-library into html page
- Why is React rendering my component over and over with an unchanged state?
- React JS rendering elements with on click function and passing index to on click function
- How to deal with a value that might be an array, or might be only a single item react component
- React rendering the component twice and 2nd disappears after a flash, [DOM] found 2 elements with non-unique id
- client rendering react component to html in browser client side with styles
- React Component not loading with Webpack and Babel Beginner's level
- React component not rendering in django index html template
- React conditional rendering bug even with single parent and child list
- Converting React component to a single js file to integrate it with a blank html
- Fetching data from firebase with React Class component is rendering twice and even more
- initialise react component with props and return as html string
- Control html dynamically without component re rendering in React with Apollo
- React/Mobx: How to pass single item from a mapped array into another component and retrieve only the item associated with the value clicked
- React - animate mount and unmount of a single component
- How to mock React component methods with jest and enzyme
- How to set up Babel 6 stage 0 with React and Webpack
- Prevent react component from rendering twice when using redux with componentWillMount
- React - useRef with TypeScript and functional component
- Syntax error in IE11 with Webpack, Babel and React
- How to test decorated React component with shallow rendering
- Spying on React functional component method with jest and enzyme; Cannot spyOn on a primitive value
- Jest/Enzyme Class Component testing with React Suspense and React.lazy child component
- How to test a component with a nested container with React and Redux?
- HTML special character (& symbol) not rendering in React component
More Query from same tag
- Disable RootStateOrAny in React typescript?
- How to map a nested object
- New to TypeScript, what does this chunk of code do?
- Why am I getting this error in my CollectionCard.js (REACT)
- Why is each MenuItem in my react-contextmenu list identical?
- ReactJS - Setting state with multiple JSON-objects, keeps returning undefined/non-changed
- How do I restrict the type of React Children in TypeScript, using the newly added support in TypeScript 2.3?
- reactjs gives me this error: TypeError: this.state.coords.map is not a function
- How to convert string date-time range to javascript date objects?
- How can I pull various claims out of the access token?
- Setting a default value to an input field in React?
- rsuite date range selector- remove 'Ok' button
- Send data from child to parent React
- How to check for esim eligibility in react-native app?
- Making clean double successive axios requests with React/redux
- Router history with react-router 4.0.0
- Where to setState the props value coming from parent component in child component?
- ./src/App.jsx Attempted import error: 'Routes' is not exported from 'react-router-dom'
- React / Unit Test (Jest) click method with preventDefault
- How to retrieve remote IP address in an Axios call from Node
- react redux UI not updating after store change
- React Synthetic Events Bubble Capture with Components
- Pass Props to this.props.children
- Add class to individual button using react Hook
- React Hooks state is not updating with correct output
- Can't properly type the following HOC function accepting a custom property key
- Syntax Error React.js
- Is there a better way to display content depending on the route?
- How do I deal with d3.json to get my InitialState in React/redux
- NextJs Authentication with Next-Auth against DRF