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 https://fb.me/react-error-boundaries 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 https://fb.me/react-crossorigin-error 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{
 data.map((user, i) => {
 let date = new Date(lesson.startTime);
 let time = `${date.getHours()}:${(date.getMinutes()<10?'0':")+date.getMinutes()}`;
 if(lesson.room === 'Room 1' && time === '9:00'){
return(

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

 ) 
}
 }) 
 } catch(e){
console.log(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
{
render(){
return(
....
<lesson room="Room 3" time="9:30">
....
)}
}</lesson>

All of the code here https://codepen.io/rusline/pen/NyBYVY?editors=0011
June 7th 19 at 15:39
1 answer
June 7th 19 at 15:41
Solution
Well, at least, need to return something from your Lesson. Ie must be more than just data.map, and return data.map.

Find more questions by tags React