Naming Things is Hard

Today I Learned

...a little bit more about subcomponents in Fractal

I'm learning how to use Fractal to develop a pattern library. I'm loving it. That said, one dumb thing has been tripping me up, and I finally found out why, in the docs:

When you include a sub-component in the manner described above, it's important to note that you are effectively just including the contents sub-component's view file. It will not automatically include any context data that you may have defined for that sub-component.

The docs go on to offer some ways to get context data into the subcomponents; for me, right now, just dumping in some data into my context variable in my config.yml files does the trick. Eventually I'll get around to learning how to do it dynamically via JS. (I've dabbled in that sort of thing in 11ty, and it's fun, it's fun to be able to do that.)


Home & About &