reka.js icon indicating copy to clipboard operation
reka.js copied to clipboard

Bug if default object is instantiated with global value

Open def-roth opened this issue 1 year ago • 0 comments

Occurs if objects are set as defaults for props after closing and reopening the code editor. Then a comma is inserted wrong.

val isModalOpen:any = false;

// good
component Header(
 default={"open": isModalOpen }
) => (...)
val isModalOpen:any = false;

// bad
component Header(
 default:any={,
 "open": isModalOpen,
 }
) => (...)

If the comma gets removed one gets an unexpected error at the beginning of the document. Which is fixed if both commas are rmoved as in the good example.

def-roth avatar Nov 20 '23 14:11 def-roth