79808661

Date: 2025-11-04 08:23:24
Score: 1
Natty:
Report link

In order for a component to take properties

As @natashap mentioned in the comment, you need to convert it to a component instead of a variable

//File A.jsx

export const V = ({text, prop1, prop2}) => {
    //use properties

    return <div>{text}</div>
}
//File B.jsx

import {V} from './A.jsx'

export const F = () => {
    return (
        <>
            <V text='text' prop1='prop1' prop2='prop2'/>
        <>
    )
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @natashap
  • Low reputation (0.5):
Posted by: Mohammad Ali