express-engine-jsx icon indicating copy to clipboard operation
express-engine-jsx copied to clipboard

Optional props defaults to `null`

Open RayyanNafees opened this issue 1 year ago • 1 comments

How to make the compiler treat all the props as optional and in absense of providing value to the prop, either ignores it or injects null in its place

instead of returning errors

RayyanNafees avatar Apr 20 '24 06:04 RayyanNafees

all templates compiles to regular React components. Can show how to change main template to implement what you want?

I prefer to show all props like this

const {
  active = false,
  disabled = false,
} = props;

redexp avatar Apr 22 '24 08:04 redexp