The Passing Functions to Components FAQ page discusses some strategies for passing parameters to the callbacks, out of which using data attributes on DOM elements for better performance is an addition to the ones described on the Handling Events docs.
I wrote about a similar pattern for class components, and was wondering if it would be a good addition to the FAQ page. (Of course, I'd love to know whether the things I say there are accurate, misinterpret the performance implications in any way, or generally sound like bad ideas.)
Tangentially, it may be a good idea to link to the FAQ from the Handling Events page? I was initially not aware there's extra information on the subject.
I must add that the React website is one of the best documentations I've ever read through, and in particular the FAQ section seems to include actual frequent questions :)
The Passing Functions to Components FAQ page discusses some strategies for passing parameters to the callbacks, out of which using
dataattributes on DOM elements for better performance is an addition to the ones described on the Handling Events docs.I wrote about a similar pattern for class components, and was wondering if it would be a good addition to the FAQ page. (Of course, I'd love to know whether the things I say there are accurate, misinterpret the performance implications in any way, or generally sound like bad ideas.)
Tangentially, it may be a good idea to link to the FAQ from the Handling Events page? I was initially not aware there's extra information on the subject.
I must add that the React website is one of the best documentations I've ever read through, and in particular the FAQ section seems to include actual frequent questions :)