This was used to allow clients to pass ref and key
to createElement, which is no longer necessary due to intersection
types. If you need to declare a props object before passing it to
createElement or a factory, use ClassAttributes<T>:
var b: Button | null;
var props: ButtonProps & ClassAttributes<Button> = {
ref: b => button = b, // ok!
label: "I'm a Button"
};
This was used to allow clients to pass
ref
andkey
tocreateElement
, which is no longer necessary due to intersection types. If you need to declare a props object before passing it tocreateElement
or a factory, useClassAttributes<T>
:var b: Button | null; var props: ButtonProps & ClassAttributes<Button> = { ref: b => button = b, // ok! label: "I'm a Button" };