I couldn't get this to work displaying errors or repopulating field values using the example code. I'm no expert but dug around in the source a bit and tried some stuff, and found this works:
{% set message = submission ?? null %}
Steps to reproduce
Copy example code
Fill in a couple of fields but make sure it won't validate (e.g. leave 'message' blank)
Send
Errors do not display and any fields you filled in do not maintain their values
Additional info
Craft version: 4.0.1
PHP version: 8.0.8
Database driver & version: MySQL 5.7.34
Plugins & versions: Redactor 3.0.0; Contact Form 3.0.0; Contact Form Honeypot 2.0.0
Description
The example code in the readme includes the line:
I couldn't get this to work displaying errors or repopulating field values using the example code. I'm no expert but dug around in the source a bit and tried some stuff, and found this works:
Steps to reproduce
Additional info