prism-react-renderer icon indicating copy to clipboard operation
prism-react-renderer copied to clipboard

Request to expose useGetLineProps, useGetTokenProps, useThemeDictionary

Open dentrado opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Feature Request

Hi! It would be great if you could expose:
- `useGetLineProps()`
- `useGetTokenProps()`
- `useThemeDictionary()`

Previously you exposed `useTokenize` which is great!(https://github.com/FormidableLabs/prism-react-renderer/issues/236) 
But to render those tokens in my own component it would help a lot if
I could still use `getLineProps` and `getTokenProps`, which it
seems like I should be able to do if the above three hooks were exposed.

dentrado avatar Jul 24 '24 10:07 dentrado

I agree, this would be a great addition, currently in order to access things like lineCount ahead of time you have to organize your whole code around the <Highlight> component or call useTokenize separately just for that, it's a little awkward

Georgegriff avatar Jul 28 '24 01:07 Georgegriff

@dentrado @Georgegriff Could you describe your use case for us? I'm trying to understand how your using it without the Highlight component. We can certainly expose these internal hooks, but I want to be sure it will actually solve your use cases.

carbonrobot avatar Sep 04 '24 18:09 carbonrobot

Just want to check in @dentrado and @Georgegriff and see if you had any additional information that could help us.

carbonrobot avatar Nov 19 '24 11:11 carbonrobot

Closing due to lack of feedback from requestors

carbonrobot avatar Dec 11 '24 17:12 carbonrobot