Reactiflux

R

Reactiflux

Join the community to ask questions about Reactiflux and get answers from other members.

Join
Ddmikester11/12/2024

Axios helper file with interceptors, how to turn it into a context provider?

I have an Axios helper file I have created to add interceptors to my Axios instance. The problem is I am making a hook call in there: const { instance } = useMsal(); and after some research, I have learned you cannot do that outside of a functional component. So now I think from digging more into this, the only way is to make a Axios provider and wrap my app in that? Is that the best way? If so, how do I do that? Here is the code in my Axios file: ```js import axios from 'axios';...
XXero1/5/2024

Next JS Module With wasm File and Module Not Found Error

I'm trying to run code from an npm library called opencascade. I installed it using npm install opencascade.js@beta When trying to run it I get a weird error ``` ./node_modules/opencascade.js/dist/opencascade.full.wasm...
あすぱる12/3/2023

Is impure to update "other component's" useRef within useEffect?

I saw the article "Keeping Components Pure" on react.dev and have a question. Is there any problem with "updating refs of other components received via props in useEffect" as shown below? ```tsx function ChildComponent({ r: MutableRefObject<{ foo: string }> }) { useEffect(() => {...
Solution:
There's nothing really "wrong" with it besides being overly complicated. In most cases, like you said, there are better ways to accomplish something similar. Passing refs around is not something I would recommend unless there's a REALLY good reason for doing so.
Message Not Public
Sign In & Join Server To View