Do you know if there ever will be an update to the SharePoint template written as Functional Components instead of Class based?
@Andrew_Connell
7 ай бұрын
Unfortunately I can't say. I gave that feedback to Microsoft, as have many others, but so far we haven't seen anything :(
@DWBattleMusic
7 ай бұрын
Hey Andrew, is your course made with classes or Functions? Im looking for a course which uses Functions. Like a "newer version" kind of.
@Andrew_Connell
7 ай бұрын
Assume you're asking about my Mastering the SPFx course? I don't teach hooks in the course, but I have a chapter dedicated to React. Because the course is about SPFx and not React or React hooks, I use React (and other frameworks) as little as possible & instead, keep it as pure SPFx as I can. But, the React chapter does include two sample projects, one built using React class components, and the same project using functional components & hooks. Does that help?
@DWBattleMusic
6 ай бұрын
@@Andrew_Connell I was more thinking about how the SPFx are setup. When creating an SPFx, u recieve class components, in one of your videos youve shown how to change it to functioncal components. Ive learned React in functional components and would rather avoid going back to class components. So I was wondering if your Mastering the SPFx course is made in classes or functional components. Or am I asking something pointless? As to is it not really relevant what I am asking and the course will not have a lot typescript/react code in it.
@Andrew_Connell
6 ай бұрын
My course is about the SharePoint Framework (SPFx), not React. There is one chapter where I focus on React, but that's it. In all other chapters, I focus on SPFx and thus, usually don't use React in the instructor-led demos. You said: 🙋♂️ "I was wondering if your Mastering the SPFx course is made in classes or functional components." Neither... the class is about SPFx, not React. There's just one chapter that covers React and the lessons in that chapter focus more on React class components (today, with plans to re-record it and add a discussion about hooks) because by default SPFx uses class components. But, as I show in this video, you can convert it to a functional component. The download for that chapter includes the same demos but done both as class components AND functional components so students can see both types. You said: 🙋♂️ "As to is it not really relevant what I am asking and the course will not have a lot typescript/react code in it." I'm not sure what you're asking here... SPFx is 100% client-side and thus all code you write is TypeScript. Every single demo has TypeScript in it because it's impossible to do SPFx without TypeScript.
@DWBattleMusic
6 ай бұрын
@@Andrew_Connell Ayt I get it now, thanks a lot for the very detailed answer. Ill be going for it soon. Looking forward to it!
@Andrew_Connell
6 ай бұрын
@@DWBattleMusicSo that clears up your questions? Fantastic! Hey... if you have any more questions about my course, feel free to ask away! www.voitanos.io/course-master-sharepoint-framework/
@buzzlightbeer1636
8 ай бұрын
Quick question on your useMemo comment here: kzitem.info/news/bejne/sq9sx4agkaJ4f2ksi=gSRULgrMPxVoD1XD&t=341 You mention that filteredItems only recalculates when items and searchTerm are updated. What exactly would need to change in items for it to trigger a re-render? if a property of an item changes or count of items changes? or in this case, does it recalculate any time you use setItems even if the array of items does not differ after setItems is called?
@Andrew_Connell
8 ай бұрын
That's the last parameter of the useMemo() hook. The array contains two things: "items" & "searchTerms".. if either changes, that triggers the code in useMemo() to execute which updates the "filteredItems" constant (which is a state object) and thus, triggers a re-render. To your last question, anytime the "items" constant changes, which can be done with the setItems() method.
Пікірлер: 11