REACT AND REDUX
Where components marry state machines.
PRESENTATIONAL, PURE, FUNCTIONAL STATELESS, DUMB COMPONENTS
These types of components go by many names and have only one job, and that's to
render the information given to them. Typically this information is passed in
through a component's properties.
The most accurate name for these components in my opinion is "functional
stateless components", for the following reason:
....
function statelessComponent(property1, property2) {
return `
Some text: ${property1}
`;
}
....
CONTAINER, SMART, FUNCTIONAL STATEFUL, SMART COMPONENTS
The opposite to those components, are stateful or "smart" components, which can
encapsulate complex logic and side-effects to be reused.
Once again, in my opinion the most accurate thing to call these are "functional
stateful components", because you write functions that hold state.
`CONNECT' OR USING REACT-REDUX TO MAKE YOUR LIFE PLEASANT
....
import { connect } from 'react-redux';
const statesToProperties = state => { thing: state.ok }; const
dispatchFunctionsToProperties = state => { func1: () => dispatch({ type: TYPE'
}) };
connect(statesToProperties,
dispatchFunctionsToProperties)(functionalStatelessComponent);
....