theKashey / react-focus-lock

It is a trap! A lock for a Focus. 🔓
MIT License
1.27k stars 67 forks source link

Replace defaultProps with default function parameters #260

Closed wojtekmaj closed 10 months ago

wojtekmaj commented 10 months ago

As default props on function components are going to be deprecated in future release in favor of default function parameters (see: https://github.com/facebook/react/pull/16210), I followed the recommendation. Note that default function parameters were actually already used (see lockProps for example)!

wojtekmaj commented 10 months ago

This is the only package under my maintanace still using propTypes and still configuring defaultProps.

Well, for these poor souls stuck on JavaScript for whatever reason, propTypes may actually come in handy. I personally keep it in all my TypeScript repositories anyway.