# Confusion with marks and toggleMark

**URL:** <https://discuss.prosemirror.net/t/confusion-with-marks-and-togglemark/3915>\
**Category:** Uncategorized\
**Created:** [July 22, 2021, 1:44pm UTC](https://discuss.prosemirror.net/t/confusion-with-marks-and-togglemark/3915 "2021-07-22T13:44:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orestis](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/orestis/32/1707_2.png) [@orestis](https://discuss.prosemirror.net/u/orestis)\
**Post date:** [July 22, 2021, 1:44pm UTC](https://discuss.prosemirror.net/t/confusion-with-marks-and-togglemark/3915/1 "2021-07-22T13:44:27Z")

</div>

So I’m trying to make my own toolbar in React. I’m using prosemirror-example-setup and prosemirror-menu and trying to copy bits and pieces from there. I’m using ClojureScript so not sure if any code snippets might be useful to anyone else 😕

I’m seeing two issues that might be related:

1. My bold/strong button is never “active”. The `markActive` function which is a literal copy of the one in [prosemirror-example-setup/menu.js at master · ProseMirror/prosemirror-example-setup · GitHub](https://github.com/ProseMirror/prosemirror-example-setup/blob/master/src/menu.js) returns false.
2. Whenever I click the bold button, I see the marks applied to the text nodes, but never un-applied; as a second press of the toolbar will add another mark.

Whenever I use cmd-b it toggles/untoggles the selection as expected, but it seems like it’s in its own parallel universe. I was suspicious that the React integration (via use-prosemirror) would be at blame but I have verified that the state available via that is the same as the state accessible via view.state.

Any pointers on how to debug this would be helpful.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [July 22, 2021, 1:58pm UTC](https://discuss.prosemirror.net/t/confusion-with-marks-and-togglemark/3915/2 "2021-07-22T13:58:01Z")

</div>

Are you maybe using mark types from different schemas? That might cause some of these symptoms.

---

<div class="post-metadata">

**Author:** ![orestis](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/orestis/32/1707_2.png) [@orestis](https://discuss.prosemirror.net/u/orestis)\
**Post date:** [July 22, 2021, 2:35pm UTC](https://discuss.prosemirror.net/t/confusion-with-marks-and-togglemark/3915/3 "2021-07-22T14:35:03Z")

</div>

Thank you so much, I was creating the schema inside a React render method and it was recreated on every render. Moving that out fixed the issue, now everything works as expected. Many thanks again!
