What could be the reason for Material UI xs={12} not extending to the full width of a mobile screen?

click here for image

On my mobile screen, my components should be taking up the entire width but they seem to have an invisible margin on the right.

    <React.Fragment>
  <CssBaseline />
    <ThemeProvider theme={theme}>
      <Grid container direction='column'>
        <Grid container justifyContent='center'>
          <Grid item xs={12} sm={10}>
              <Header connectWallet={connectWallet}/>
          </Grid>
        </Grid>
        <Grid container justifyContent='center' alignItems='center'>
          <Grid item sx={{minHeight: 'calc(100vh - 400px)'}} xs={12} sm={10}>
            <Switch>
              <Route path="/bouquets">
                <Bouquets />
              </Route>
              <Route path='/about'>
                <About />
              </Route>
              <Route path="/">
                <Home />
              </Route>
            </Switch>
          </Grid>
        </Grid>
        <Grid item xs={12}>
          <Footer/>
        </Grid>
      </Grid>
    </ThemeProvider>
</React.Fragment>

Answer №1

    <Container
        fluid
        item
        sx={{
         background: '#FFFFFF',
         min-height: {
            xs: '100vh',
            md: 'auto',
           xl: 'auto',
           lg: 'auto'
         },
width: { xs: "100%", md: "auto", xl: 'auto',
           lg: 'auto' } 
        }}
    >
        <Row itemSize={8}>
        <Block>size=8</Block>
        </Row>
        <Row itemSize={4}>
        <Block>size=4</Block>
        </Row>
    </Container>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Setting a default value for a null Select Option in React: a guide

I am currently working with an array of values and looping through them to display in a Select Option. <Form.Item label="Status"> <Select value={user.status} onChange={handleStatusChange} > ...

The float right feature in IE7

Here is the code I am working with: // CSS .foo strong { float: right; } // HTML <div class="foo"> foo <strong>bar</strong> </div> I am trying to float the "strong" element to the right, but unfortunately Internet Exp ...

What could be causing the issue with my Material-ui React combo-box not updating properly?

After putting together a React component with a combo-box, here is the code I came up with: import React from 'react'; import MenuItem from '@material-ui/core/MenuItem'; import TextField from '@material-ui/core/TextField'; ex ...

Error: The property 'ref' of 'register(...)' cannot be destructured because it is undefined while testing React Hook Form V7

Currently in the process of upgrading from React Hook Form V6 to V7. Managed to successfully update, but encountering some issues with a few tests now. The specific error message being displayed is: TypeError: Cannot destructure property 'ref' of ...

Assigning roles on signup with Auth0 in NextJS: A step-by-step guide

Recently, I've been exploring the library called nextjs-auth0 (https://github.com/auth0/nextjs-auth0) and have been attempting to utilize the handleAuth hook to extract a query argument for specifying the user's role upon signing up. Here is an ...

The challenge of integrating Bootstrap Dropdown with server side rendering in Next.js

I am currently working on creating a navigation bar with dropdown options that contain several links. While it appears to be functioning correctly in the browser, I have noticed that the HTML code for the dropdown menu is not visible in the page source. N ...

Creating line breaks in Bootstrap input group formatting

My issue involves rows with checkboxes and labels, some of which are longer than others. When the browser is resized or viewed on a mobile device, the columns containing longer labels collapse to a second row while shorter labels stay beside their checkbox ...

Components undergo a style transformation with Material UI

I've noticed that every time I render the component, the styles keep changing. import React from 'react'; import FormControl from '@material-ui/core/FormControl'; import MenuItem from '@material-ui/core/MenuItem'; im ...

Utilizing Ajax to Dynamically Update Link Styles

When using an AJAX request to load a portion of a webpage, the content is delivered by a framework and then inserted into the DOM tree using jQuery. Everything seems to be working well so far. However, I encountered an issue when trying to use background ...

NextJS encounters an AxiosError with the code ERR_BAD_REQUEST

I recently encountered an error while trying to implement a login system in my NextJS app. The error message reads as follows: AxiosError {message: 'Request failed with status code 400', name: 'AxiosError', code: 'ERR_BAD_REQUEST ...

Filtering elements upon loading

I have successfully implemented data filtering on my website using data-filter. While everything is working great, I am interested in displaying items with specific attributes upon loading. For instance, I want to load only green objects by default inste ...

Looking to align a radio button in the middle of an inline-block?

Is it possible to center a radio button within an inline-block? I have provided a demo on JSFiddle that displays the current layout and how I envision it should appear. Check out the demo here Here is the code snippet in question: <span style="widt ...

I encountered an error while attempting to import a file into Firebase Storage

I've been struggling to upload files from Firebase Storage and encountering errors despite reading the documentation and various blogs on the topic. I'm looking for the most effective approach to resolve this issue. import { storage } from ' ...

React Intl: Asynchronously loading a singular locale's data in a Universal Application

Hey there, I'm currently working on a universal app that supports multiple languages using React. I'm facing challenges with handling locale data efficiently. The app will be available in 16 different languages with a large amount of translated m ...

Bug in localStorage with the default MUI dashboard template

Currently in the process of developing my nextjs application. To kick things off, I decided to utilize the default dashboard theme available on the MUI website at https://mui.com/material-ui/getting-started/templates/dashboard/. You can view the code snipp ...

Angular 10: A guide to dynamically highlighting navbar elements based on scrolling position

I am currently working on a single-page application using Angular 10. I have a simple page layout and I want to implement a feature that will highlight the navbar based on the scroll position. How can I achieve this functionality in a single-page applicati ...

Dealing with multiple occurrences of forward slashes in a URL

Currently utilizing React and grappling with resolving duplicate forward slashes on my site in a manner similar to Facebook. The process functions as follows: For example, if the user visits: https://facebook.com///settings, the URL is then corrected to h ...

When implementing ngIf conditions within a nested loop of the side menu in Angular 6, the collapse/expand CSS function does not seem to be functioning

this code dynamically binds a nested loop in the sidebar <ul class="nav metismenu" id="side-menu" *ngIf="concatMenulist?.length > 0"> <li *ngFor="let menu1 of concatMenulist"> <!--level 01--> ...

REACT_APP environment variables not correctly loaded in .env file

Currently working on a React application and in need of fetching data from my API. I am looking to store the API url as an environment variable for security purposes. Despite having my .env file set up and dotenv installed, I am facing an issue where pro ...

How can I set a background image to automatically adjust to the width of the window, be full height, allow for vertical scrolling, and

How can I set a full-screen background image that adjusts to the body width without horizontal scrolling, maintains height proportionate to width, and allows for vertical scrolling? Here is my current code: html, body { margin: 0px; padding: 0px; } bo ...