Samuel
this works in dev mode, but passing --no-dev means that the function never fires when you press the touchable. removing the void fixes it. wtf
2 10
shreyan (wise)
JavaScript is not, in fact, a touchable, and trying to press it in production will fail, so you must send it to the void
1 6
Samuel
bad and naughty functions get sent to t̷̻̣̺͙̎͐ḩ̷̡͇̮͚͚̬̝͍̮͋̇̈́̏̊͂͌̒͜ͅͅe̷͚͆̔ ̶͉͕͔̩̞̳͔̟̜̥̥̈́̂̓̌͂́̈́̓́̂v̴̝͗̇̄̏̔̎̅̓̈͋̽͠͝o̷̡̦̳̤͚̖̩̞̙͔̙̯̊͐͆́̏̓̏̅́̚̚͝͝͝͝ͅi̷̺̬̇d̴̝̼̪̻̰̲̝̈́͋͐ͅ
5
Matt Gilg
Probably IIFE? Never in my career have I needed to use a JS void keyword. "Welcome to JavaScript, where everything is made up and the rules don't matter" 🤣
1 3
Samuel
I think I had it there due to some dumb eslint rule, but it really shouldn’t change whether the function gets called or not!
2 3
Micah ΘΔ
We definitely had the "no unhandled promises" eslint rule that suggested adding a void before the call that returned a promise to swallow it, but ran into similar issues like this.... `void` is evil in modern javascript, cast it away
2
Matt Gilg
"shouldn't" 😅 Famous last words. "void 0" is short for "undefined" but void 1 probably isn't? (Or something equally as silly)
domi
probably production only code optimization that shouldn't really happen. it evaluated that this undefined is not even worth executing for lmao
4
Michel Bestaat
A more serious answer: I guess in release mode the whole expression got (erroneously) optimized away as you void it?
1 3
Samuel
must be some sort of bundling/transpilation mistake?? idk, it broke after updating to Expo 50/React Native 0.73
1