Skip to content

Fix non-boolean conditions passed to DisplayIf

Nicolas Frandeboeuf requested to merge nicofrand/kresus:fixTypeError into master

DisplayIf expects a boolean as condition prop but sometimes we pass it a truthy/falsy value (ex: a number). STR: search something in the transactions list, and you should read the stack below in the console:

Warning: Failed prop type: Invalid prop `condition` of type `number` supplied to `DisplayIf`, expected `boolean`.
    in DisplayIf (created by OperationsComponent)
    in OperationsComponent (created by ConnectFunction)
    in ConnectFunction
    in Unknown (created by BaseApp)
    in Unknown (created by ConnectFunction)
    in ConnectFunction
    in Unknown (created by BaseApp)
    in Route (created by BaseApp)
    in Switch (created by BaseApp)
    in div (created by BaseApp)
    in main (created by BaseApp)
    in BaseApp (created by ConnectFunction)
    in ConnectFunction
    in Unknown (created by ConnectFunction)
    in ConnectFunction
    in Route
    in Switch
    in ErrorReporter
    in Unknown (created by ConnectFunction)
    in ConnectFunction
    in Provider
    in Router (created by BrowserRouter)
    in BrowserRouter

Merge request reports

Loading