Passing custom props to the settings component #264
Replies: 1 comment 2 replies
-
If I am understanding your question correctly do you mean like this? You can pass whatever you need inside of props and if you need another section outside of props in your component.craft you would put Component.craft = { And you'd make a new section like toolbar called customBar in this case and in the index.ts for it you'd do this: Then in like you have your ButtonSettings you'd also have a ButtonCustomSettings but instead of using the props from the .craft you'd get the custom object ex: const {nodeCustomSettings} = useNode(node => ({ |
Beta Was this translation helpful? Give feedback.
-
Hi, I was going through the examples and was trying to build a page builder for myself. I think this one has some very solid use-cases. The documentation is pretty exhaustive and helpful, but I am stuck with trying to achieve one thing.
Can I get some help with the way the settings panel renders the right settings component here - https://craft.js.org/r/docs/0.1.0-beta.6/guides/basic-tutorial/#settings-panel-1?
Essentially, I am trying to pass in some custom props while creating the element, but it doesn't seem to work. Say, for e.g.
My settings component does not receive 'foo' as a prop. This seems to be happening here - https://github.com/prevwong/craft.js/blob/develop/packages/core/src/utils/createNode.ts#L136
Beta Was this translation helpful? Give feedback.
All reactions