# astrimid - Is there some kind of context wrappe... Channel: #support Source: https://discord.com/channels/1233487248129921135/1529847276053336076 Started: 2026-07-23T13:46:54.322000+00:00 Last activity: 2026-07-23T17:58:51.594000+00:00 ## astrimid — 2026-07-23T13:46:53.799000+00:00 Is there some kind of context wrapper that would inject props to each component that supports them? E.g. using `schSectionName` for each component is frustrating. Would be much more ergonomic to use {/*components*/} As I understand, `` already exists. But it doesn't support children. So to put a component there, you need to find each component that supports `schSectionName` property and pass down it there. You could also put the whole subcircuit into schematic section as it support `schSectionName`. But you can't create a group of component using `children` property and put it into schSection without any side effects? ## Mustafa7 — 2026-07-23T13:53:31.323000+00:00 yea i think we should support adding children to `schematicsection` just like `schematicsheet`, wdyt <@757706909351411845> ? ## Mustafa7 — 2026-07-23T14:22:40.462000+00:00 https://github.com/tscircuit/props/pull/749 https://github.com/tscircuit/core/pull/2791 ## astrimid — 2026-07-23T15:49:08.887000+00:00 made a package until this is in review: https://tscircuit.com/astrimid/sch-section-wrapper#files Attachment: image.png — https://community.tscircuit.com/media/1529878041722093668 ## astrimid — 2026-07-23T15:52:38.524000+00:00 Ok. This works for schematic section, but not for shematic sheet. Apparently, you can't put schematic section into a schematic sheet? ## astrimid — 2026-07-23T16:10:58.535000+00:00 This doesn't work, because changing the section's sheet doesn't change the component's sheet. We end up with a sheet with empty sections, even though the components specify that they belong to sections. Attachment: image.png — https://community.tscircuit.com/media/1529883534154666105 Attachment: image.png — https://community.tscircuit.com/media/1529883534418903272 ## astrimid — 2026-07-23T16:14:50.781000+00:00 So we can define `schSectionName`​ for components, and we can place schematic section to the sheet, but components will fall out of schematic section as soon as it is moved into a sheet, because they don't have `schSheetName`​ defined as prop. ## astrimid — 2026-07-23T16:17:01.470000+00:00 I guess what I'm still trying to do is to decouple model implementation from presentation, which `tscircuit` doesn't appear to be friendly to. ## astrimid — 2026-07-23T16:17:42.417000+00:00 It's just too good at reconciliation 😆 ## astrimid — 2026-07-23T16:21:04.637000+00:00 Maybe I should just create my own `` wrapper which would traverse the JSX tree and modify it programmatically to solve all the bugs I encounter. 😅 ## Seve — 2026-07-23T17:00:15.998000+00:00 yea this is a pretty easy one to resolve, first we update the tscircuit/props spec, create a reproduction in tscircuit/core, then PR an implementation fix, should be out today ## astrimid — 2026-07-23T17:52:54.156000+00:00 What I need to ouput is this: a component which targets schematic sheet and schematic section, a schematic page and a schematic section, one nested in another. I also need a workaround for `` which doesn't currently support the `schSectionName`: probably just place it on a page, without a section? Ideally, I'd like separate nesting of schematic page and sections, so that I could reuse and reorder sections in pages without touching components? But maybe sections have transparent coordinate system, so I wouldn't be able to reposition sections anyway? Or maybe I can go one level deeper and recalculate `schX` and `schY` while I'm at it? So many questions... Attachment: image.png — https://community.tscircuit.com/media/1529909185188331730 ## astrimid — 2026-07-23T17:56:30.717000+00:00 I guess something like this could work: ``` import React from "react" import { SchSection, SchSheet } from "@tsci/astrimid.sch-section-wrapper" export default () => ( ) ``` But this way I could only change the order in which schematic pages are placed on a sheet, which doesn't help at all, sinse, there's nothing like flexbox to recalculate `sch` coordinates of all components in a section as I place them in different order on a sheet? ## astrimid — 2026-07-23T17:57:36.601000+00:00 This could be sufficient, as it doesn't look like you can place same component in multiple sections or multiple sheets? ## astrimid — 2026-07-23T17:58:51.594000+00:00 You could arguable create multiple `