You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first one we can get the readonly type directly and it's easy to writing.
The second one, we can get the readonly interface, but if there are more properties we have to repeatedly declare its readonly modifier.
The third one, we can get the readonly interface directly, it assign a non-readonly interface to a type. And the State3 seems should be eliminated.
Whether we have a way to define a readonly interface just like the first way does?
I expect to define a React State interface directly which is readonly.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Code
There three ways we can define a readonly type or interface.
The first one we can get the readonly type directly and it's easy to writing.
The second one, we can get the readonly interface, but if there are more properties we have to repeatedly declare its readonly modifier.
The third one, we can get the readonly interface directly, it assign a non-readonly interface to a type. And the State3 seems should be eliminated.
Whether we have a way to define a readonly interface just like the first way does?
I expect to define a React State interface directly which is readonly.
The text was updated successfully, but these errors were encountered: