Closed rakshixh closed 3 weeks ago
Hi there,
Can I work on this ?
Hi @rakshixh,
Whether I need to add Astro components in all the examples ? Because certain examples are somewhat small. So, if I add Astro Components as well it will make it complex. Can you clear my doubt.
Hey @Nitheesh-2003
Yeah because it will maintain the ui across the site. Even if it is small code snippet! All you need to do is import that component from astro in mdx file then dump the code file in txt format inside the 'codes/{your issue folder}/{code snippet file}.txt'
Please note that we have already created folder so that you can dump n number of code snippet txt files inside that folder! Please check the folder structure! If you have any further questions please ask!
But in case of hooks if you are displaying only const [file , setFile] = useState();
This you can use md format no need to use the astro component!
But if the snippet is more than 2 lines including brackets etc then please use astro components!
One more clarification, Actual code will be in the code directory. Then whether I need to mention something in place where the example needs to be placed in the mdx file
One more clarification,
Actual code will be in the code directory. Then whether I need to mention something in place where the example needs to be placed in the mdx file
Actual code will be inside the Codes/{file-folderName}/
Please nite that codes directory will be under the main dropdown on which you are working for example: if your working on React then path will be React/Codes/{file-folderName}/
You no need to specify the path in mdx!
But to display the code in mdx file you need to import that code file into mdx. You can refer astro's code component to know how to display code!
Hi @rakshixh,
I have created the PR. Can you please review it and confirm. Thanks
π Issue Description
Add the following content for Hooks in React under REACT
File you will be working on:
src\content\docs\react\hooks.mdx
π― Expected Outcome
The expected outcome is to add a well-documented and informative section under React that covers the following topics:
useState
hook to manage state in functional components, with examples of how to initialize and update state.useEffect
hook for handling side effects like data fetching or subscriptions, with examples of controlling when effects run and how to clean them up.useContext
hook for accessing values from the Context API to manage global state.useRef
hook for referencing DOM elements and persisting values across renders without triggering re-renders.useReducer
hook to manage complex state logic, particularly in large-scale applications.useMemo
hook to memoize expensive calculations and avoid unnecessary re-renders, with practical examples.useCallback
hook to memoize functions and improve performance in React applications, with examples demonstrating the need for memoizing functions.The content should be written clearly, with examples where necessary, and provide value for developers who are new to hooks or looking to deepen their understanding of React Hooks. Please don't make use of the AIs.
π§ Solution Guidance (Optional)
π Steps to Reproduce
src\content\docs\react\hooks.mdx
file in the repository.MDX
π‘ Additional Context (Optional)
π Hacktoberfest Participation
βοΈ This issue is tagged for Hacktoberfest. βοΈ PR should reference this issue and adhere to contribution guidelines.
π₯ Contributors
If you are working on this issue, please comment below to let us know. Feel free to ask any questions! Don't forget to go through the Code of Conduct and follow the CONTRIBUTING guidelines.
Thank you for contributing to Hacktoberfest and helping improve this project!