2017-11-03 3 views

答えて

1

あなたはケースのブランチ内からreturnまたはbreakに忘れてしまった:

/* @flow */ 

type StepApplicationAction = { type: "STEP_APPLICATION" } 
type RewindApplicationAction = { type: "REWIND_APPLICATION" } 

type ApplicationAction = StepApplicationAction | RewindApplicationAction 

type RequestVinsAction = { type: "REQUEST_VINS" } 
type ReceiveVinsAction = { type: "RECEIVE_VINS", vins: Array<string> } 

type VehicleAction = RequestVinsAction | ReceiveVinsAction 

type Action = ApplicationAction | VehicleAction 

function reducer(action: Action) { 
    switch (action.type) { 
    case "REQUEST_VINS": console.log('HERE'); return; 
//           ^^^^^^^ 
    case "RECEIVE_VINS": 
     console.log(action.vins); return; 
    default: 
     return; 
    } 
} 

Try Flow

関連する問題