Skip to content

TypeError: _app_site_components_home_megaMenu_styled__WEBPACK_IMPORTED_MODULE_8__.styles.bar is not a function #300

Description

@mehrdadKianiAnbohi

i have problem in stylex, when i use stylex.props for call function, get this error: TypeError: app_site_components_home_megaMenu_styled__WEBPACK_IMPORTED_MODULE_8_.styles.bar is not a function

import * as stylex from "@stylexjs/stylex";

export const styles = stylex.create({
  container: {
    ...theme.row,
    boxShadow:'0 5px 15px rgba(0, 0, 0, 0.06)',
    padding:'16px 16px',
    borderRadius:16,
    marginBottom:32,
  },
  bar: (height) => ({
    height,
    // The function body must be an object literal
    // -- { return {} } is not allowed
  }),
});

<div {...stylex.props(styles.container)}>
  <div {...stylex.props(styles.bar(20))} >new products</div>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions