Currently, I am working with ReactJS and incorporating MaterialUI components library into my project. However, I have encountered a problem with the Typography component.
When I input a long text, it overflows its container without breaking onto a new line:
import React from "react";
import { Redirect } from "react-router";
import { withRouter } from "react-router-dom";
import Container from "@material-ui/core/Container";
import CssBaseline from "@material-ui/core/CssBaseline";
import Typography from "@material-ui/core/Typography";
function Homepage() {
return (
<div>
<React.Fragment>
<CssBaseline />
<Container fixed>
<Typography variant="h1" component="h2" align="center">
123 456 789 qwertyuiopasdfghjklzxcvbnm
</Typography>
</Container>
</React.Fragment>
</div>
);
}
export default withRouter(Homepage);
Here is an image for reference:
https://i.stack.imgur.com/G3X9w.png
This issue occurs in both mobile and desktop views.
Is there a solution to ensure that long words are split onto a new line when they reach the maximum width of the container?