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
[OptimizelyProvider UserAttributes Type Definition mismatch] The type definition for the user attributes does not match the documentation and is limiting types allowed #922
The new package has defined the UserAttributeValue to be a limited set of types which contradicts the documentation stating it supports any type. What's happening now is that if you have a custom type being set as an attribute you will receive a typescript error because the type is not supported.
Expected Behavior
The user prop in the OptimizelyProvider should allow any type definition as stated in the documentation instead of the currently defined type:
export type UserAttributeValue = string | number | boolean | null;
⬇️
export type UserAttributeValue = any;
or simply:
export type UserAttributes = {
[name: string]: UserAttributeValue;
};
⬇️
export type UserAttributes = {
[name: string]: any;
};
Steps To Reproduce
setup a project with the lastest react sdk
In the OptimizelyProvider's user prop, add a custom attribute that has a json value: