rhw-repo/mern-post-app

Debug Select Creatable component when rendered in CreateNew

rhw-repo opened this issue · 2 comments

CreateNew.js line 144
Runtime: Infinite loop occurs when this component renders ExperimentalAllTagsSelect
Occurs in isolation: does not occur when ExperimentalAllTagsSelect is used in Edit.js
Review useEffect hooks to prevent loop occuring
During this fix, carefully rename Experimental AllTagsSelect - component name is too long

  1. Issue:
  • is not useEffect in ExperimentalAllTagsSelect
  • was component infinite re-render caused by continual firing of function to update of tags on render in CreateNew.js

Introduced if statements to ensure that not fire:

  • on render until user interacts with tags field
  • if selectedTags not already and empty array
  1. "During this fix, carefully rename Experimental AllTagsSelect - component name is too long" - decision to make this a separate Issue for clarity.

Bug fixed in bugfix/create-new, which is now merged into dev branch.