Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
React Hooks: How to pass function from one component to another?

I have an app with the following structure.

App.js

function App() {
  return (
    <BrowserRouter>
      <Navbar />
      <EditorWrapper />
    </BrowserRouter>
  );
}

export default App;

EditorWrapper.js

import EmailSettings from "../features/signature/Settings";

function EditorWrapper() {

  return (
    <div>
      <div>
        <Switch>
          <Route exact path="/settings/"  component={EmailSettings}/>
        </Switch>
      </div>
    </div>
  );
}

export default EditorWrapper;

Navbar.js

function Navbar() {
  return (
    <nav class="navbar navbar-light bg-light">
      <span class="navbar-brand mb-0 h1">Save</span>
    </nav>
  );
}

export default Navbar;

Settings.js

function Settings() {
  const handleSubmit = () => {
    //save data
  }
  return (
    <div>
      <button onClick={() =>handleSubmit()}>Save</button>
    </div>
  )
}

export default Settings;

Problem: How do I pass the function handleSubmit from settings to navrbar.js without using redux?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!