classtranscribe / FrontEnd

The React + Redux Frontend for ClassTranscribe
https://classtranscribe.illinois.edu
Other
26 stars 28 forks source link

No unstable React component (ChapterContent.js) #626

Closed angrave closed 1 year ago

angrave commented 1 year ago

Updating the linter I noticed this issue- src/screens/EPub/views/EditEPubChapter/ChapterEditor/ChapterContent.js

Line 60:16: Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “ChapterContent” and pass data as props react/no-unstable-nested-components

Other lint output in the same file included- Line 23:42: Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style Line 60:16: Function component is not a function declaration react/function-component-definition Line 60:28: Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style Line 105:36: Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

angrave commented 1 year ago

Addressed in 3f1ebae939d5de6583c662497f2d6fc762a5bef1