0

Let's say we have LWC

export const PROGRAM_TYPE = {
ISV   : 'AppExchange',
SI : 'Consulting'

};

and

import PROGRAM_TYPE from 'c/pdxConstantsCommon';

inside parent component. but i'm not able to reach e.g. PROGRAM_TYPE.ISV value but

console.log(PROGRAM_TYPE) says 

PROGRAM_TYPE: ISV: "AppExchange" SI: "Consulting"

but both PROGRAM_TYPE.SI and PROGRAM_TYPE.ISV are undefined. What am i doing wrong?

1 Answer 1

0

there is need to use

import {PROGRAM_TYPE} from 'c/pdxConstantsCommon';
3
  • Can you explain your answer? If you want to have a single source for these constant values I think storing them in their own module is the proper approach and that way other components can import them as needed.
    – nbrown
    Commented Feb 8, 2021 at 13:35
  • there is need to share constants with another components
    – pincet
    Commented Feb 8, 2021 at 14:08
  • @nbrown curly brakes matter ;)
    – pincet
    Commented Feb 8, 2021 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .