If I upgrade to Bridge 16 / Bridge.React 2.4.0 then when inspecting 'i' in the example below, the '_reactElement' property 'key' isn't set. If I make the 'Key' property in the Props class lowercase this appears to resolve the issue.
[Ready]
public static void Main()
{
var i = Enumerable.Range(0, 10).Select(x => new TestComponent(x.ToString())).ToArray();
//@ debugger
}
public class TestComponent : PureComponent<TestComponent.Props>
{
public TestComponent(string key) : base(new Props(key)) { }
public override ReactElement Render() => null;
public class Props : IAmImmutable
{
public Props(string key)
{
this.CtorSet(_ => _.Key, key);
}
public string Key { get; }
}
}
A couple of tips that are totally unrelated to this issue:
If you have a "public static void Main" method then Bridge seems to automatically start it after the scripts are all loaded, you don't need a [Ready] attribute
You can use "Script.Debugger();" instead of dropping into JavaScript - just allows the compiler to catch typos (I don't know why but my fingers often try to type "debubber")
If you want to follow the classes-shouldn't-be-unsealed-by-default (and you would surely be bananas not to!) then the public ProductiveRage.SealedClassVerification.Bridge NuGet package has an analyser to help - more details available at github.com/ProductiveRage/ProductiveRage.SealedClassVerification
If I upgrade to Bridge 16 / Bridge.React 2.4.0 then when inspecting 'i' in the example below, the '_reactElement' property 'key' isn't set. If I make the 'Key' property in the Props class lowercase this appears to resolve the issue.