Can i use "UseState"?

System Information
  • Strapi Version:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:


I would like to create a function that generates a random number when i publish a post.
To do that, i would like to modify my create() controller and import my function here. In my function i have “useState”, but it seems that i can not import it.

Could you help me please ?
Thank you

useState is a React hook, controller is in backend code, it is a node application.

1 Like

Indeed. Thank you. I was able to do what i wanted.