How am I able to get the updated value of the `TextFormField` without using `setState((){})`?

On `TextFormField` 's `onChanged` method, I am setting the class variable to the value, but normally we would need `setState((){})` for the value to be updated. I am just wondering how is this working?

```
class ResetPasswordPage extends StatefulWidget {
  const ResetPasswordPage({ Key? key }) : super(key: key);

  @override
  _ResetPasswordPageState createState() => _ResetPasswordPageState();
}

class _ResetPasswordPageState extends State<ResetPasswordPage> {

String _currentPassword = '';

  void onChanged(){
    print('current Password is: ');
    print(_currentPassword); ----------->this is printing the updated value, without setstate?

  }

  @override
  Widget build(BuildContext context) {
    return Container(
       TextFormField(
         onChanged: (val) => {
           _currentPassword = val,
           onChanged()
         },
      ),
    )
 }

}

```