HOME DOCS PWA ABOUT
  1. Replicator
    1. Write
    2. Read
    3. Upgrading the Container
  2. Concepts
    1. Storing Information
    2. Writing Specifications
    3. Retrieving Information
  3. Create an App
    1. Create React App
    2. Install Jinaga
    3. Define a Model
    4. Initialize a Starting Point
    5. Declare a Component
    6. Match Successor Facts
    7. Declare a Child Component
  4. Write Tests
    1. Write Some Tests (JavaScript)
    2. Write Some Tests (TypeScript)
    3. Create Related Facts
    4. Query Facts
    5. Export the Model (JavaScript)
    6. Export the Model (TypeScript)
    7. Authorize Facts
  5. Conventions
    1. JavaScript
    2. TypeScript
  6. Reference
    1. Jinaga
      1. fact
      2. query
      3. watch
      4. for
      5. match
      6. exists
      7. notExists
      8. not
      9. hash
      10. login
      11. local
      12. service
      13. onError
      14. onLoading
      15. onProgress
      16. graphviz
      17. inspect
    2. Preposition
      1. then
    3. Syntax diagram
  7. Jinaga React
    1. Composition
    2. Field Specification Functions
      1. field
      2. projection
      3. collection
      4. property
      5. mutable
      6. array
  1. Jinaga React
  2. Field Specification Functions

projection

A projection produces a single child component. This is useful for breaking down the rendering into several components. The only parameter is the mapping of the child component. That mapping will start from the same fact as the current specification.

{
    UserView: projection(userViewMapping)
}

Give projections a capitalized name so that you can use them as regular React components within your render function.

const pageMapping = userSpec(({ UserView }) => (
    <UserView />
));

Continue With

collection