react-universal-container
Version:
Allows React and React-Native front end Components to use the same properties, and gives you the ability to write your important code once.
17 lines (16 loc) • 804 B
JavaScript
import { UniversalContainer } from 'react-universal-container';
function didTapItem(item) {
console.log("The most important `shared` code is executed here");
// A more realistic kind of 'shared' callback action would be dispatching
// redux actions to a redux store inside this function. Or using business
// logic to determine what should happen; or start a HTTP API request. The
// main point is that you write this _important_ code once, here.
}
/**
* UniversalContainer subclasses are usually just prop and state holders.
* A common use case would be for `ToDoListContainer` to connect to redux and
* map Dispatch actions so that the `component` object has those functions
* available to via its own props.
*/
export class ToDoListContainer extends UniversalContainer {
}