Testing

Reducer transition test

Call a reducer with controlled input and compare its output and mutation behavior; test UI separately.

Formal Syntax & Structure

react syntaxreact
const next = reducer(previous, action);

Working Example

Example Snippetreact
formReducer({phase:"details",name:""},{type:"next"});
React Reference