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

211
Vistas
Functions in App.js not showing up in .jsx file

I have a react website and have a jsx file that is trying to call some functions I defined in my App.js

import React from "react";
import function1 from './App.js'
import function2 from './App.js'
import function3 from './App.js'

function Home() {
  return (
    <div className="home">
      <div class="container">
        <div>
          {function1() ? function2(): function3()}
        </div>
      </div>
    </div>
  );
}

export default Home;

I then have an App.js file that looks like this:

import React from 'react';
import './App.css'

function App() {
    const function1 = () => { 
        return booleanvalue
    }
    const function2 = () => { 
        return (<button onClick={...} ... </button>)
    }
    const function3 = () => { 
        return (<button onClick={...} ... </button>)
    }
}

export default App;

But nothing shows up from the jsx file. I tried exporting these functions at the end but this also doesn't do anything. Is there any way I can export these local functions within my App() or call them because I am already exporting App?

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

0

import './App.css'
    export const function1 = () => { 
        return booleanvalue
    }

export const function2 = () => { 
        return (<button onClick={...} ... </button>)
    }

    export const function3 = () => { 
        return (<button onClick={...} ... </button>)
    }

export function App() {



}

export {App, function, function2, function3 }

This is how you export functions, but if you want React components then your component should start with a capital character.

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