11 Matching Annotations
  1. Nov 2019
    1. Injector components should never be self-closing, and they should never wrap multiple children. We can fix this at code-time and not wait for the errors at runtime.
    2. React Native has also used this pattern in TouchableWithoutFeedback
    3. we use a LOT of injector components to abstract out logic and nicely separate concerns like style, animation, and interactions from our layout components.
    4. An injector component takes props, optionally computes new ones, then injects them into its child via React.cloneElement(). Crucially, it also does not add any new components to the DOM.
    1. Aligning closely with the <Injector_ > naming convention, Null Components are denoted with a prefix and postfix _ (e.g. <_NullComponent_ />).
  2. Feb 2017
    1. In general, add providers to the root module so that the same instance of a service is available everywhere.

      So, from this I take it that once a Service is added to the root module, it can be used by any component of that module.

      What about the components imported, from sub-modules of the root one? Can their dependency needs be met, in similar fashion? For example, could a Component in another module (imported into the root one) just request a Service provided in the root module and have it properly injected from there, without anything else on the developer's part?

    2. you get a new instance of the service with each new instance of that component

      So, I take it that the Service instance will not be a singleton anymore? Whereas, if provided from the root module, it will?