react-chatbot-kit icon indicating copy to clipboard operation
react-chatbot-kit copied to clipboard

Sharing State Between Custom Messages

Open jebberwocky opened this issue 9 months ago • 2 comments

Can we share the state between custom messages?

scenario:

  • there are 2 custom messages A and B and customMessages: { a: (props) => <A {...props} />, b: (props) => <B {...props} />,

  • there is a state const [isLoaded, setIsLoaded] = useState(false); in A

  • like to share const [isLoaded, setIsLoaded] = useState(false); from A to B

  • B can call setIsLoaded

thanks

jebberwocky avatar Apr 29 '24 06:04 jebberwocky