Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda