I try to use functional react components where I can, but something I've found conceptually confusing for a while now is passing a function to a component. This is confusion has been particularly apparent when using an external React library and I've been tasked to enhance a default component property with some additional feature which … Continue reading Passing Functions to Components in ReactJS and passing new parameters
Tag: Functional programming
Controlling your stateless React components
This is a very short summary of React.memo that was introduced in React 16.6 in Oct 2018 and can be used as a wrapper around stateless functional components. Some examples demonstrating stateless functional components are below: import React from 'react'; //nameless default functional component export default (props) => { return <button disabled={props.buttonDisabled}>{props.text}</button> } //named functional … Continue reading Controlling your stateless React components