I am very new to react.js. When I was working on a practice project, I encountered this strange error. Some components from an external js file render when imported and some do not.
app.js:
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Hello from './components/hello'
import functionalClick from './components/fuctionalClick'
class App extends Component {
render() {
return (
<div className="App">
<Hello name='Lol '></Hello>
<functionalClick></functionalClick>
</div>
);
}
}
export default App;
functionalClick.js:
import React from 'react'
function fuctionalClick() {
return (
<div>
<button>Click</button>
</div>
)
}
export default fuctionalClick
hello.js:
import React from 'react';
const Hello = (props) => {
return (
<div>
<h1>
Hello {props.name}!
</h1>
</div>
);
}
export default Hello;
The functionalClick.js does not render But the first method does(hello.js). Even when the syntax i followed, was almost same.enter image description here