LLJS icon indicating copy to clipboard operation
LLJS copied to clipboard

React native casting error

Open Darshan972 opened this issue 5 years ago • 6 comments

I am getting an error after writing this code that the type cast expression is expected to be wrapped with parenthesis. Here is my code:

onPressedButton = channelId => {

this.setState(this.state.channelId: channelId) // here i am getting the error

Darshan972 avatar Aug 31 '19 12:08 Darshan972

Try this :-

onPressedButton =(channelId) => { this.setState ({ channelId : channelId })

shubhamaniket avatar Sep 01 '19 15:09 shubhamaniket

Hey I have a new issue on React Native please solve I have uploaded it on GitHub . Username: Darshan972

On Sun, Sep 1, 2019, 9:08 PM Shubham Aniket [email protected] wrote:

Try this :-

onPressedButton =(channelId) => { this.setState ({ channelId : channelId })

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mbebenita/LLJS/issues/42?email_source=notifications&email_token=AMU7NELONFXNU6YZKUCGSLTQHPOWFA5CNFSM4ISTRVGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5UEZVQ#issuecomment-526929110, or mute the thread https://github.com/notifications/unsubscribe-auth/AMU7NEJFJDNEHU6ZMTSAYZTQHPOWFANCNFSM4ISTRVGA .

Darshan972 avatar Sep 10 '19 14:09 Darshan972

I am getting an error after writing this code that the type cast expression is expected to be wrapped with parenthesis. Here is my code:

onPressedButton = channelId => {

this.setState(this.state.channelId: channelId) // here i am getting the error

Did the solution which i provided , worked?

shubhamaniket avatar Sep 10 '19 15:09 shubhamaniket

Yes it worked , but after it get another error.

On Tue, Sep 10, 2019, 8:35 PM Shubham Aniket [email protected] wrote:

I am getting an error after writing this code that the type cast expression is expected to be wrapped with parenthesis. Here is my code:

onPressedButton = channelId => {

this.setState(this.state.channelId: channelId) // here i am getting the error

Did the solution which i provided , worked?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mbebenita/LLJS/issues/42?email_source=notifications&email_token=AMU7NENDK5SXAGRNBIYM6XLQI6ZVDA5CNFSM4ISTRVGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6LNVEY#issuecomment-529980051, or mute the thread https://github.com/notifications/unsubscribe-auth/AMU7NEI6HHSCOAYVLPYAWY3QI6ZVDANCNFSM4ISTRVGA .

Darshan972 avatar Sep 10 '19 15:09 Darshan972

I uploaded the problem on Github

On Tue, Sep 10, 2019, 8:37 PM Anonymous 2 [email protected] wrote:

Yes it worked , but after it get another error.

On Tue, Sep 10, 2019, 8:35 PM Shubham Aniket [email protected] wrote:

I am getting an error after writing this code that the type cast expression is expected to be wrapped with parenthesis. Here is my code:

onPressedButton = channelId => {

this.setState(this.state.channelId: channelId) // here i am getting the error

Did the solution which i provided , worked?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mbebenita/LLJS/issues/42?email_source=notifications&email_token=AMU7NENDK5SXAGRNBIYM6XLQI6ZVDA5CNFSM4ISTRVGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6LNVEY#issuecomment-529980051, or mute the thread https://github.com/notifications/unsubscribe-auth/AMU7NEI6HHSCOAYVLPYAWY3QI6ZVDANCNFSM4ISTRVGA .

Darshan972 avatar Sep 10 '19 15:09 Darshan972

Hey , can you help me I have a problem in my code.

On Tue, Sep 10, 2019, 8:38 PM Anonymous 2 [email protected] wrote:

I uploaded the problem on Github

On Tue, Sep 10, 2019, 8:37 PM Anonymous 2 [email protected] wrote:

Yes it worked , but after it get another error.

On Tue, Sep 10, 2019, 8:35 PM Shubham Aniket [email protected] wrote:

I am getting an error after writing this code that the type cast expression is expected to be wrapped with parenthesis. Here is my code:

onPressedButton = channelId => {

this.setState(this.state.channelId: channelId) // here i am getting the error

Did the solution which i provided , worked?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mbebenita/LLJS/issues/42?email_source=notifications&email_token=AMU7NENDK5SXAGRNBIYM6XLQI6ZVDA5CNFSM4ISTRVGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6LNVEY#issuecomment-529980051, or mute the thread https://github.com/notifications/unsubscribe-auth/AMU7NEI6HHSCOAYVLPYAWY3QI6ZVDANCNFSM4ISTRVGA .

Darshan972 avatar Oct 10 '19 16:10 Darshan972