// maybeObject: object | undefined
// isFoo: boolean
{maybeObject && (isFoo ? <Aaa /> : <Bbb />)}
// autofixes to:
{!!maybeObject && isFoo ? <Aaa /> : <Bbb />}
This has an entirely different meaning. My original code was hiding everything if maybeObject was undefined. The new code will display <Bbb /> instead.
To show how absurd this is, in other spot in my codebase, the else condition of the ternary was also maybeObject. This meant that my new code had a runtime error.
This has an entirely different meaning. My original code was hiding everything if
maybeObjectwasundefined. The new code will display<Bbb />instead.To show how absurd this is, in other spot in my codebase, the
elsecondition of the ternary was alsomaybeObject. This meant that my new code had a runtime error.