I am new to React and I've been told its a better way to use function components than class components and I have come to an error where I am unable to show components that I included, I don't really understand what is wrong hence the explanation might be wrong.
Please see my sandbox link for errors
https://codesandbox.io/s/sweet-andras-y1g6o?file=/src/App.js
My code as below
import React from "react";
import { Button } from "antd";
const Order = () => {
const showAction = () => {
<Button type="primary" size="small">
{" "}
{"View"}
</Button>;
<h1>Here</h1>;
};
return (
<div>
<h1>Hello{showAction()} Button is here</h1>
</div>
);
};
export default Order;
I am expecting it to show Hello {Button} Here Button is here, but instead it shows
Hello Button is here
returninside yourshowAction function