About 249,000 results
Open links in new tab
  1. How can I use a function from another file in react?

    Jan 15, 2019 · You are not assigning value of i to anything in your main component. for example you can return i from your function, and then after importing function into your file, you can do: …

  2. Importing and Exporting Components – React

    How to import and export a component; When to use default and named imports and exports; How to import and export multiple components from one file; How to split components into …

  3. How import and export components (functions) in ReactJS?

    Apr 11, 2018 · import React, { Component } from 'react'; import './App.css'; import Search from './Search'; // Import the function. import { getValueInput, filterNames } from './path/filters'; export …

  4. React Importing and Exporting Components - GeeksforGeeks

    Mar 21, 2025 · In React, importing and exporting components refer to the process of sharing and using components across different files in your application. JavaScript’s import and export …

  5. how to use a function from another js file in reactjs?

    Mar 27, 2017 · In order to import something, you need to export it from the other module. For example, you could export class YourComponent extends React.Component in something.js. …

  6. How to call function from another file in ReactJS - Altcademy Blog

    Nov 8, 2023 · Importing a Function. On the other side, the file that needs to use this function needs to import it. Importing is like telling ReactJS, "Hey, I need this function from that file". …

  7. React ES6 Modules - W3Schools

    ES Modules rely on the import and export statements. You can export a function or variable from any file. Let us create a file named person.js, and fill it with the things we want to export. There …

  8. Importing Utility Functions in React.js - Pluralsight

    Sep 24, 2020 · As your React.js app grows, logical routines are extracted from your code as utility functions and placed in another file so other components can use them.

  9. Export multiple Functions or Components from file in React

    Apr 7, 2024 · Use named exports to export multiple functions in React, e.g. export function A() {} and export function B() {}. The exported components can be imported by using a named …

  10. How to include an external JavaScript library to ReactJS

    Apr 10, 2025 · We can use different methods to include external JavaScript libraries in ReactJS. Step 1: Create a React application using the following command inside your terminal or …

  11. Some results have been removed
Refresh