-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Closed
Description
Hello! Really love new features and architecture of Fiber.
But because of this new behavior:
Non-event attributes with function values:
React 16: Warns and ignores them.
I've got this issue:
const fn = () => null;
fn.toString = () => 'foo';
const render = () => (
<div className={fn}>doesn't add class</div>
);It wouldn't add className, even if i've override toString method, but with object it works:
const obj = { toString: () => 'foo' };
const render = () => (
<div className={obj}>works</div>
);I think it's OK to have same behavior with function and object.
This feature is needed in "bem-cn" like library, so I can write just fn, instead of fn() or fn.toString()
acjay and JabbyPanda
Metadata
Metadata
Assignees
Labels
No labels