question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RichtoolBar causing warning: To fix, cancel all subscriptions and asynchronous task in the componentWillUnmount method

See original GitHub issue

When I use the toolbar and then go back to the previous screen the warning comes out, but if i dont, this warning doesnt come out, i dont know why its causing this, this is my toolbar:

<RichToolbar editor = {this.richText} onPressAddImage = {this.insertImage} actions = {[ actions.insertBulletsList, actions.insertOrderedList, actions.insertImage, "change_text_color", ]} iconMap ={{ [actions.insertBulletsList]: () => <Text style = {this.styles.icon}><MaterialIcons name = "format-list-bulleted" size = {this.option_icon.size} color = {this.option_icon.color}/></Text>, [actions.insertOrderedList]: () => <Text style = {this.styles.icon}><MaterialIcons name = "format-list-numbered" size = {this.option_icon.size} color = {this.option_icon.color}/></Text>, [actions.insertImage]: () => <Text style = {this.styles.icon}><MaterialIcons name = "image" size = {this.option_icon.size} color = {this.option_icon.color}/></Text>, change_text_color: () => <Text style = {this.styles.icon}><MaterialIcons name = "format-color-text" size = {this.option_icon.size} color = {this.option_icon.color}/></Text>, }} change_text_color = {this.change_color} style = {{backgroundColor: backgroundColor, borderTopWidth: 1}}> </RichToolbar>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ariesbrylle-bmscommented, Nov 25, 2020

This is how I did it – the text doesn’t get highlighted when I scroll.

<ScrollView style={{ height: 300 }} keyboardDismissMode={“none”}> <InsertLinkModal onCancel={() => onCancel()} onDone={(title, url) => onLinkDone(title, url)} isVisible={modalVisible} /> <RichEditor ref={richText} useContainer={false} containerStyle={{ minHeight: height, height: height, width: “100%”, borderWidth: 1, borderColor: CONSTANTS.LIGHT_BG_COLOR, }} editorStyle={{ backgroundColor: “white”, borderColor: CONSTANTS.PRIMARY_COLOR, }} placeholder=“Type your action here.” editorInitializedCallback={editorInitializedCallback} onHeightChange={(e) => { if (e > 300) { setHeight(e); } }} /> </ScrollView>

1reaction
ariesbrylle-bmscommented, Nov 25, 2020

@ydhnwb @ariesbrylle-bms, when you guys scroll the text gets highlighted?

no, mine doesn’t highlight. I think I found a way not to crash the app. What causes it is the toolbar so I waited for the RichEditor to be loaded before I load the toolbar.

{mounted == true ? ( <RichToolbar editor={richText} … /> ) : null}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cancel All Subscriptions and Asyncs in the ... - Stack Overflow
To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. - node_modules/fbjs/lib/warning.js:33:20 in ...
Read more >
How to clean up subscriptions in react components using ...
This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the...
Read more >
How to work with React the right way to avoid some common ...
Warning : Can't call setState (or forceUpdate) on an unmounted component. ... To fix, cancel all subscriptions and asynchronous tasks in the ...
Read more >
Can't perform a React state update on an unmounted ... - Reddit
I keep getting this Error: Warning: Can't perform a React state update on ... To fix, cancel all subscriptions and asynchronous tasks in...
Read more >
How to cancel all subscriptions and asynchronous tasks in a ...
React Hook Warnings for async function in useEffect: useEffect function must return a cleanup function or nothing…. To fix this problem, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found