This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I removed everything bar the component with the binds and hopefully I can just point you in the right direction. | |
// when we look at doctorFormBlocks.map, there's two issues. One being that you're creating a new function instance with your | |
// bind every render (which you correctly identified). But two, your map has an arrow function inside it which also results | |
// a new function instance every render! This would certainly add up. | |
// Below is the class as you had it before. The way I would do it is to just make your map an instance method on | |
// the component. | |
// Before | |
export default class DoctorsPage extends React.Component { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For each image in the dataset, output this object: | |
// { src: "picture-3.jpg", caption: "Lorem Ipsum Dolor 2<br>Ut enim ad minim veniam, quis nostrud exercitation ullamco<br>2017" } | |
const data = [ | |
{ | |
"title": "Lorem Ipsum Dolor 1", | |
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco.", | |
"year": "2018", | |
"images": [ | |
"picture-1.jpg", |