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

195
Vistas
Can't import components into React main JS file

I've been trying to learn React for a while now, and my mentor gave me the task of learning how to create (in React) a to-do list. I've been watching a tutorial, everything went well at first, but I got stuck when starting to use components.

In the tutorial, he creates a different component for the "form", which I'll recall in the App.js file.

Here is the App.js file:

    import './App.css';
import Form from './components/Form';

function App() {
  return (
    <div className="App">
      <header>
        <h1> Adi's ToDo list </h1>
      </header>
    </div>
  );
}

export default App;

Here is also the Form.js file:

function Form() {
  return (
    <form>
      <input type="text" class="todo-input" />
      <button class="todo-button" type="submit">
        <i class="fas fa-plus-square"></i>
      </button>
      <div class="select">
        <select name="todos" class="filter-todo">
          <option value="all">All</option>
          <option value="completed">Completed</option>
          <option value="uncompleted">Uncompleted</option>
        </select>
      </div>
    </form>
  );
}

export default Form;

VSC tells me to remove import Form from and to just use import './components/Form'; but that doesn't change anything.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to actually use Form component for VSC to not suggest removing it. Try:

<div className="App">
  <header>
    <h1> Adi's ToDo list </h1>
  </header>
  <Form />
</div>
about 4 years ago · Juan Pablo Isaza Denunciar
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