Skip to content
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

Request to expose useGetLineProps, useGetTokenProps, useThemeDictionary #246

Open
2 tasks done
dentrado opened this issue Jul 24, 2024 · 3 comments · May be fixed by #249
Open
2 tasks done

Request to expose useGetLineProps, useGetTokenProps, useThemeDictionary #246

dentrado opened this issue Jul 24, 2024 · 3 comments · May be fixed by #249
Assignees
Labels
enhancement New feature or request

Comments

@dentrado
Copy link

dentrado commented Jul 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • 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.
@Georgegriff
Copy link

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

@carbonrobot carbonrobot added the enhancement New feature or request label Aug 29, 2024
@acharyakavita acharyakavita self-assigned this Sep 4, 2024
@acharyakavita acharyakavita linked a pull request Sep 4, 2024 that will close this issue
12 tasks
@acharyakavita acharyakavita linked a pull request Sep 4, 2024 that will close this issue
12 tasks
@carbonrobot
Copy link
Contributor

@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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants