Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
Changing the Redux Store caused my App to stop Rendering

I'm learning React/Redux, and while rewriting my redux store to better store the state and add async thunks, my app stopped rendering. My console shows no errors and the page is blank.

App.js

import './App.css'
import React from 'react'
import SearchBar from '../features/search/SearchBar'
import Post from '../components/Post'
import Subreddits from '../components/Subreddits'
import { BsReddit } from 'react-icons/bs'

const App = () => {
    let listOfPosts = []
    for (let i = 0; i < 5; i++){
        listOfPosts.push(<Post iterator={i} />)
    }
    
  return (
        <main>
            <header>
                <h1>
                    <BsReddit />
                    <span>Reddit</span> Minimal
                </h1>
                <SearchBar />
            </header>
            <div className='post-container'>
                {listOfPosts.map((post, i) => <li key={'post_' + i}>{post}</li>)}
            </div>
            <Subreddits />
        </main>
    );
}

export default App

store.js

import { configureStore } from '@reduxjs/toolkit'
import { postsReducer } from '../features/posts/postsSlice'
import React from 'react'

export const store = configureStore({
  reducer: {
    posts: postsReducer
  }
})

index.js

import React from 'react';
import ReactDOM from 'react-dom';
import App from './app/App';
import { store } from './app/store'
import { Provider } from 'react-redux'

const render = () => {
  ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root')
);
}
store.subscribe(render)

I can show more of the code, but i assume the problem is somewhere in these 3 files. I truly don't understand why its not rendering.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda