score:0

the obvious error here is a copy&paste one:

  return (
    <div classname="app">
      <div classname="content">
      {!isloaded && (
      <provider store={store}>
      <app />
      </provider>,    // remove this comma
      rootelement     // remove this line
      )}

but that won't solve your problem itself. rendering it just like you initally showed should be possible.

your problem is most commonly caused by multiple versions of react, react-redux or react-dom being installed at the same time.

you can check that via yarn why react etc. telling you how to fix it goes a bit beyond the scope of a stackoverflow question with a different question though - there are just too many options ;)

score:0

solved. i tried to render <provider> from app.js when i should have rendered from index.js. here is how my index.js looks like now:

import react from 'react';
import reactdom from 'react-dom';
import './index.css';
import app from './app';
import reportwebvitals from './reportwebvitals';
import { createstore } from 'redux';
import { provider } from "react-redux";
import { counter } from './cart.js';

let store = createstore(counter);

reactdom.render(
  <react.strictmode>
    <app />
  </react.strictmode>,
  document.getelementbyid('root')
);
reactdom.render(
  <provider store={store}>
    <app />
  </provider>,
  document.getelementbyid('root')
);

reportwebvitals();

Related Query

More Query from same tag