Material-ui: [Docs] List example failing due to missing MobileTearSheet

Created on 30 Jan 2016  路  10Comments  路  Source: mui-org/material-ui

Module not found: Error: Cannot resolve 'file' or 'directory' ../../../MobileTearSheet in /Users/admin/repos/asp-log-viewer/app/assets/js

I temporarily made a workaround by changing <MobileTearSheet> to <div>

bug 馃悰 docs

Most helpful comment

is not real helpful when the example give does not work :(

All 10 comments

MobileTearSheet is an internal component designed to indicate that the example is truncated. We need to change the path from relative to absolute so the example works externally, but @oliviertassinari should we also add a comment on the code examples to use a div instead?

We need to change the path from relative to absolute

Oh, no that won't help of course since the MobileTearSheet component isn't in the npm.

This component was removed in the next branch. We will no longer have the issue 馃帀 .
@mbrookes Sorry, I know you liked it.

@oliviertassinari Don't worry, I'm putting it back! 馃槇

But uhmmm, why was it removed? ;-(

@StephanBijzitter MobileTearSheet is an internal docs component that adds the zigzag-bottomed outline to List examples. Since it is used in the examples it can cause confusion when the example code is copy pasted.

If we are to maintain the appearance of the examples for the `next branch, we'll have to find an implementation that doesn't have that dependancy.

is not real helpful when the example give does not work :(

Having MobileTearSheet in docs is really confusing. Using <div> instead solves the problem.

I was really hoping to use <MobileTearSheet> for displaying a receipt 馃檨

Paper can be used to overcome this issue

const style = {
    width: 400,
    margin: 20,
    display: 'inline-block',
  };


export default function ListCard() {
    return (
        <Paper style={style} zDepth={3}>
            <List>
                <ListItem primaryText="Inbox" leftIcon={< ContentInbox />}/>
                <ListItem primaryText="Starred" leftIcon={< ActionGrade />}/>
                <ListItem primaryText="Sent mail" leftIcon={< ContentSend />}/>
                <ListItem primaryText="Drafts" leftIcon={< ContentDrafts />}/>
                <ListItem primaryText="Inbox" leftIcon={< ContentInbox />}/>
            </List>
        </Paper>
    )
}

Output:

screen shot 2018-02-07 at 11 49 44 am

Was this page helpful?
0 / 5 - 0 ratings