React: checker is not a function

前端 未结 12 1413
庸人自扰
庸人自扰 2021-02-04 23:25

I\'m getting this weird warning message in the console for my React app.

Warning: Failed propType: checker is not a function Check the render method of <

12条回答
  •  一向
    一向 (楼主)
    2021-02-04 23:51

    One more for the fun of it :) In my case I extracted regularly used models into separate files and imported them. So the proptype definition looked something like this:

     static propTypes = {
            ...
            selectedAction: shape(ACTION),
            ...
    };
    

    My error was that I wrote an additional curly in the shape:

    static propTypes = {
            ...
            selectedAction: shape({ACTION}),
            ...
    };
    

提交回复
热议问题