How do render string along with html tag in react. I just want to add redirecting in 10 seconds to next line but I'm getting [object object] instead.
tip={"Please wait!" +<br/ >+"Redirecing in 10 seconds..."}
DEMO:
CodeSandbox Link
How do render string along with html tag in react. I just want to add redirecting in 10 seconds to next line but I'm getting [object object] instead.
tip={"Please wait!" +<br/ >+"Redirecing in 10 seconds..."}
DEMO:
CodeSandbox Link
According to the Doc :
Tip should be a string , use \n for line breaks and add whiteSpace: "break-spaces to the style of the Spin:
<Spin tip={"Please wait! \n Redirecing in 10 seconds..."} style={{ whiteSpace: "break-spaces"}}>
ReactDOM.render(
<antd.Spin tip={"Please wait! \n Redirecing in 10 seconds..."} style={{ whiteSpace: "break-spaces"}}>
<antd.Alert
message="Alert message title"
description="Further details about the context of this alert."
type="info"
/>
</antd.Spin>,
document.getElementById("container")
);
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/antd/4.0.2/antd.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/antd/4.0.2/antd.min.js"></script>
<div id="container"></div>