How to get rid of error "The above error occurred in the component:?

When I tried to make code refactoring to bring repeated value in the function, I get the error
The above error occurred in the <lesson> component:
 in Lesson (created by the Calendar)
 in tr (created by the Calendar)
 in tbody (created by the Calendar)
 in table (created by the Calendar)
 in div (created by the Calendar)
 in Calendar

Consider adding an error boundary to your tree to customize error handling behavior.
Visit to learn more about error boundaries.

Uncaught Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development. See for more information.
 at Object.invokeGuardedCallbackDev (react-dom.development.js:626)
 at invokeGuardedCallback (react-dom.development.js:476)
 at renderRoot (react-dom.development.js:10908)
 at performWorkOnRoot (react-dom.development.js:11556)
 at performWork (react-dom.development.js:11509)
 at requestWork (react-dom.development.js:11420)
 at scheduleWorkImpl (react-dom.development.js:11274)
 at scheduleWork (react-dom.development.js:11231)
 at scheduleTopLevelUpdate (react-dom.development.js:11735)
 at Object.updateContainer (react-dom.development.js:11773)</lesson>

But I do not understand what wrong I am doing. The last what I come up with is written here
Lesson function(props){
try{, i) => {
 let date = new Date(lesson.startTime);
 let time = `${date.getHours()}:${(date.getMinutes()<10?'0':")+date.getMinutes()}`;
 if( === 'Room 1' && time === '9:00'){

 <div classname="lesson">
 { => {
 return <p key="{participaints.toString()}">{participaints}</p>

 } catch(e){

Well, source had in this div display block not through td, but without success.
And in the class output I output it like this
class Calendar extends React.Component
<lesson room="Room 3" time="9:30">

All of the code here
June 7th 19 at 15:39
1 answer
June 7th 19 at 15:41
Well, at least, need to return something from your Lesson. Ie must be more than just, and return

Find more questions by tags React