Skip to content

Feature Request: custom button node data as props #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jack-skitt opened this issue Jan 6, 2025 · 5 comments
Closed

Feature Request: custom button node data as props #146

Jack-skitt opened this issue Jan 6, 2025 · 5 comments
Labels
user request Requested by user

Comments

@Jack-skitt
Copy link
Contributor

Hi,

Is it possible to have the current node data in the props of the custom button component? I.e making a pin button icon change if the current node is pinned, you would need to node the current node the button is on

@CarlosNZ
Copy link
Owner

CarlosNZ commented Jan 6, 2025

Yes, the node data is already passed to Custom Nodes (as nodeData). So you can get the location of the current node from nodeData.path.

I suggest you console.log the entire "props" object of your custom node to see all the info available (it's quite a bit, should be enough for most use cases)

@Jack-skitt
Copy link
Contributor Author

Does this apply to custom buttons? not nodes, i have logged the props coming through to the Element and it's empty

@Jack-skitt
Copy link
Contributor Author

#147
Added PR to support this

@CarlosNZ
Copy link
Owner

CarlosNZ commented Jan 7, 2025

Oh, sorry, I thought you meant Custom Nodes. Thanks for the PR, I'll check it out later today and make a new release for it.

@CarlosNZ CarlosNZ added the user request Requested by user label Jan 8, 2025
@CarlosNZ
Copy link
Owner

Closed by #147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user request Requested by user
Projects
None yet
Development

No branches or pull requests

2 participants