Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent multiply calls of render function #768

Merged
merged 4 commits into from
Jun 22, 2022
Merged

fix: prevent multiply calls of render function #768

merged 4 commits into from
Jun 22, 2022

Conversation

mortalYoung
Copy link
Collaborator

@mortalYoung mortalYoung commented Jun 22, 2022

简介

  • 修复 render 方法会调用多次,导致页面出现重复数据的问题

主要原因分析

本地无法复现的原因可能是 react 还是 16.x 的版本导致的,后面需要升级本地的 react 版本。这里的问题是因为 const App = () => moInstance.render(<Workbench />); 如上代码, App 组件因为某种原因重渲染,导致多次执行 moInstance.render 函数

Related Issues

Closed #767

遗留问题

@mortalYoung mortalYoung added the bug Something isn't working label Jun 22, 2022
@mortalYoung mortalYoung requested a review from wewoor June 22, 2022 09:00
@mortalYoung mortalYoung self-assigned this Jun 22, 2022
@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #768 (eab0df1) into main (6a8e109) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #768   +/-   ##
=======================================
  Coverage   91.64%   91.65%           
=======================================
  Files         191      191           
  Lines        5866     5869    +3     
  Branches     1404     1405    +1     
=======================================
+ Hits         5376     5379    +3     
  Misses        484      484           
  Partials        6        6           
Impacted Files Coverage Δ
src/services/instanceService.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a8e109...eab0df1. Read the comment docs.

Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@wewoor wewoor merged commit b34a8f2 into main Jun 22, 2022
@wewoor wewoor deleted the hotfix/render branch June 22, 2022 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Version 1.0.0 renders all panels twice.
2 participants