Props API
As of 1.0.0-next.40
the props api has changed, read this guide to figure out how to change your code.
Add App Types
You will need to add a file called src/app.d.ts
with the following contents:
Change usage of props
Props changed from being an object with methods (get
, set
, and has
), to a regular object.
Change how props are typed
Props are now typed globally for ease of use, you can edit the Props
interface in your src/app.d.ts
to achieve this. No more importing types everywhere you use your props.
Accessing props in commands and events
We added the props
object directly to command and event context to access it quicker:
TS & JS Config
If you are using TypeScript you should have a tsconfig.json
in your project, similiarly if you are using JavaScript you should have a jsconfig.json
in your project. They should both look something like this:
Erroring
Props previously threw an error when you tried to access soemthing that didn’t exist, this is no longer the case.