Overview
Learn the basics about the block mapper.
Setup
- Check and add any missing map files in
web/components/BlockMapper/BlockMapList.tsthat you need and follow the instructions in that file.
Important Things To Note
- You should NEVER need to modify the
web/components/BlockMapper/BlockMapper.tsx, but if you really need to, I left examples on how to do it in the comments of that file.
Creating Components
- Look at example component found in
web/components/Template - You can use the same
_map.tsxfile for any component (no changes necessary) - You no longer need to create a typescript interface for your component since all new props should be defined in
web/components/BlockMapper/BlockProps.tsx
Creating New Component Props
- Do not do redundant work, if your prop already exists in the
web/components/BlockMapper/BlockProps.tsxfile, then use that name for your component's schema file field name. - Add your prop as optional to the
Propsinterface insideweb/components/BlockMapper/BlockProps.tsx - Add your prop to the
block.fieldsvariable - Add your prop to
BlockMapobject