PHP 8 : Error Unknown named parameter $params

I have used slim 3 in our project. It was working fine with PHP 7 version. Now I am trying to upgrade the php version to PHP 8. Since then i am getting the following error,

Unknown named parameter $params

details :

file /vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php : 40
line 40
trace #0 /vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php(40): call_user_func_array()
#1 /vendor/slim/slim/Slim/Route.php(344): Slim\Handlers\Strategies\RequestResponseArgs->__invoke()
#2 /lib/API/Middlewares/JSON.php(34): Slim\Route->__invoke()
#3 [internal function]: API\Middlewares\JSON->__invoke()
#4 /vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array()

I have tried a lot to fix this issue. I could not find a solution still. Please suggest.

What have you tried? Have you tried updating your slim 3 framework to latest version?