ljharb / prop-types-tools

Custom React PropType validators
MIT License
671 stars 50 forks source link

[New] `componentWithName`: allow it to take a list of HOC names to strip off before validating #41

Closed ljharb closed 6 years ago

ljharb commented 6 years ago

b͈͘e͏̱̤̘h͟o͈̤l͉̘͓̻̘͚͍d҉̩̥̼̺ͅ ҉̺̝̞̗͓͎͍m̬͖ỵ͜ ̠̘m͚̙̩̯i̢͚̫ģ̮̺͍͚h̨̺͇̩̩t̯͕̮̗̪̬̞y͔̳̫̣̞̘̳ ̯̣r͜ḙ̙̤͈g̼̥͖ę̳͉̲͙̥̻̦x̫̤̟

ljharb commented 6 years ago

@noratarano updated, please rereview :-)

ljharb commented 6 years ago

@garrettberg nora and i talked it over on Friday, and decided explicitly to require only a list of HOC names - the idea being, a propType can/should only "ignore" an HOC that it knows is safe to ignore when considering the relevant rendering restriction.

As for Connect, that's an important one to include, so PascalCase (a subset of camelCase) should be allowed. I'll add a test case.