Check out example codes for "c# week refrences". It will help you in understanding the concepts better.

Code Example 1

WeakReference foo = new WeakReference(new Foo());

((Foo)brokerRef.Target).Bar();
((Foo)brokerRef.Target).Baz();
GC.Collect();
GC.WaitForPendingFinalizers();

Assert.IsFalse(foo.IsAlive);

Learn ReactJs, React Native from akashmittal.com