ribesg
10/11/2019, 2:11 PMcopy
function when I run my app, any idea why? Would DCE remove it or something? What can I do?ribesg
10/15/2019, 9:44 AMGarouDan
10/15/2019, 9:46 AMribesg
10/15/2019, 9:48 AMRobert Jaros
10/15/2019, 9:50 AM.copy()
? Or your compiled code fails at runtime?Robert Jaros
10/15/2019, 9:51 AMribesg
10/15/2019, 9:51 AMthana
10/15/2019, 9:51 AMribesg
10/15/2019, 9:51 AMthana
10/15/2019, 9:51 AMthana
10/15/2019, 9:51 AMIStrukturstellenAufbauChange.prototype.copy_qa0fef$
thana
10/15/2019, 9:52 AMribesg
10/15/2019, 9:53 AMribesg
10/15/2019, 9:55 AMUncaught TypeError: this.state.copy_qz9155$ is not a function
Robert Jaros
10/15/2019, 10:03 AMstate
variable, but imho this variable is not a kotlin data classRobert Jaros
10/15/2019, 10:04 AMribesg
10/15/2019, 10:10 AMdata class State
https://github.com/Ribesg/Kita/blob/4e7273269db755dbc909edd3d012cbca97b01d5d/modules/client/client-web/src/main/kotlin/fr/ribesg/kita/client/web/components/auth/Auth.kt#L28-L34ribesg
10/15/2019, 10:10 AMribesg
10/15/2019, 10:12 AMsetState((state as State).copy(loginInput = text))
IntelliJ says the cast is useless but it throw a cast exceptionRobert Jaros
10/15/2019, 10:12 AMRobert Jaros
10/15/2019, 10:13 AMthana
10/15/2019, 10:14 AMNoWhenBranchMatchedException
because of that...thana
10/15/2019, 10:15 AMwhen
expression to find out it's type. well - nothing matches because it was basically {}
ribesg
10/15/2019, 10:21 AMsetState
functions, I looked at example and they’re using States with var
properties... I don’t really like it but I guess it’s how it’s supposed to be done?Zachary Grafton
10/15/2019, 12:37 PMfun State.init() {
loginInput = ""
passwordInput = "",
isSignUpMode = false
}
Zachary Grafton
10/15/2019, 12:38 PMZachary Grafton
10/15/2019, 12:49 PMribesg
10/15/2019, 1:20 PMribesg
10/15/2019, 1:22 PMval
. I’m a React newbie so I don’t know how you’re supposed to initialize the state in a class component. Is a functional component when you use useState
?Zachary Grafton
10/15/2019, 1:31 PMZachary Grafton
10/15/2019, 1:32 PMZachary Grafton
10/15/2019, 2:30 PMRComponent
in this case. Hooks give us a way around that, and useState
is one of those hooks. I've found that useReducer
can be extremely useful as well, if you are interested.Zachary Grafton
10/15/2019, 2:32 PMribesg
10/15/2019, 2:37 PMgbaldeck
10/17/2019, 11:06 PMZachary Grafton
10/17/2019, 11:11 PM