Здравствуйте!
В App файл в реакте подключаю модуль Ref, но выдается ошибка.
Код App.js
import React, {useState} from 'react';
import {WithRef} from "./Ref"
function App() {
const [isClicker, setClicker] = useState(false);
return (
<div className="App">
<h2>React App</h2>
{<WithRef />}
</div>
);
}
export default App;
код файла Ref.js
import React from 'react';
const withRef = () => {
return (
<div>
<input placeholder='name' />
</div>
);
};
export default WithRef;
Но возникает ошибка:
src\Ref.js
Line 3:7: 'withRef' is assigned a value but never used no-unused-vars
ERROR in ./src/App.js 22:35-42
export 'WithRef' (imported as 'WithRef') was not found in './Ref' (possible exports: default)
ERROR in [eslint]
src\Ref.js
Line 18:16: 'WithRef' is not defined no-undef
Search for the keywords to learn more about each error.