Skip to content

Using Defaults #27

@pschoffer

Description

@pschoffer

Hi this is a great project @corygibbons !

What do you think about adding a prop like usingDefaultStyles that would use the defaults styles based on the extension?

So instead of:

const extension = getFileExtension(file);
const iconStyles = (defaultStyles as any)[extension] || {}; // Typescript does not like the type of defaultStyles as the key is not string

return <FileIcon extension={suffix} {...iconStyles} />

You could do (which would internally do the same as above):

const extension = getFileExtension(file);

return <FileIcon extension={suffix} usingDefaultStyles={true} />

I assume this is the most common use-case, or?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions