vytant/stimulus-decorators

Setting default `Value`s doesn't work as expected

Opened this issue · 1 comments

The documented way of setting a default value doesn't work:

@Value(String) methodValue: string = 'GET';

this.methodValue is always 'GET' regardless of what gets passed in through data-controller-method-value

Our current workaround is:

@Value({ type: String, default: 'GET' }) methodValue!: string;
vytant commented

This library used to work with Stimulus 3.0.* versions.
From Stimulus 3.1.0 the framework itself provides basic support for TypeScript, which ruins the compatibility with this library.

Anyway, I'll check what I can do here and update the library if it won't require a big change.