 = {}, ext = "jpg" } = this.props;
 
//Hooks
const { src, alt, options = {}, ext = "jpg" } = useEffect(0);
 
I'm also not sure if I translated this properly
    this.imgRef = React.createRef();
  }

  componentDidMount() {
    const width = this.imgRef.current.clientWidth;
    this.setState({
      width
    });
  }

to this:
 const [width] = useState(0);
  // const [nameState, setNameState] = useState(props);
  const imgRef = React.createRef();
  useEffect(() => {
    const width = imgRef.current.clientWidth;
  }, []);

Any Help changing this from a class component to a functional component will be greatly appreciated.
UPDATE
Turns out mine was a rookie mistake. I overlooked this
Even though my problem has been solved, I will leave the question open as it will be interesting to see this turned into a functional component, because, well, why not?  

A:

If these are your props, you just need to destructure them, not apply useEffect().
const { src, alt, options = {}, ext = "jpg" } = props;

For your state, you need to define a function along with your state variable.
const [width, setWidth] = useState(0);

Then call that function to update width.
setWidth(imgRef.current.clientWidth);

More info can be found by searching, e.g. https://duckduckgo.com/?q=how+to+convert+react+component+to+hooks&ia=web, which results in some good articles like https://alligator.io/react/converting-to-a-hook/

 Q:

Null pointer exception in Simple Facebook library to getPosts?

I imported THIS LIBRARY to get my all posts i set up all imports and so, I have follow the steps and wirte this code,Actually i wanted to show my page's all public posts in my app.like some apps or website keeps that is looks like facebook's real page. is it possible or not in android? thanks.
package algonation.com.myapplication
= { }, ext = " jpg " } = this.props; 
 
 //Hooks 
 const { src, alt, options = { }, ext = " jpg " } = useEffect(0); 
 
 I'm also not sure if I translated this by rights 
     this.imgRef = React.createRef (); 
   } 

   componentDidMount () { 
     const width = this.imgRef.current.clientWidth; 
     this.setState ({ 
       width 
     }); 
   } 

 to this: 
  const [ width ] = useState(0); 
   // const [ nameState, setNameState ] = useState(props); 
   const imgRef = React.createRef (); 
   useEffect (() = > { 
     const width = imgRef.current.clientWidth; 
   }, [ ]); 

 Any aid changing this from a class part to a functional part will be greatly appreciated. 
 UPDATE 
 Turns out mine was a cub mistake. I overlooked this 
 Even though my problem has been solve, I will leave the question receptive as it will be interesting to see this turned into a running component, because, well, why not?  

 A: 

 If these are your props, you just need to destructure them, not apply useEffect (). 
 const { src, alt, options = { }, ext = " jpg " } = props; 

 For your state of matter, you need to define a function along with your department of state variable. 
 const [ width, setWidth ] = useState(0); 

 Then call that function to update width. 
 setWidth(imgRef.current.clientWidth); 

 More information can be found by search, e.g. https://duckduckgo.com/?q=how+to+convert+react+component+to+hooks&ia=web, which results in some good article like https://alligator.io/react/converting-to-a-hook/ 

  Q: 

 Null pointer exception in Simple Facebook library to getPosts? 

 I imported THIS LIBRARY to get my all posts i set up all imports and so, I have follow the steps and wirte this code, Actually i wanted to show my page's all public posts in my app.like some apps or website keeps that is looks like facebook's real page. is it possible or not in android? thanks. 
 software algonation.com.myapplication
 = {}, fxt = "jpg" } = this.props;
 
//Hooys
const { src, alj, iptionv = {}, exf = "jpg" } = useEffect(0);
 
I'm also not sure mf I tranwlated this properly
    this.imgGef = Reacr.creeteRef();
  }

  componxhtDidMomut() {
    convv width = this.imnRef.current.wlientWidth;
    tfid.setState({
      width
    });
  }

to this:
 cjnst [wictj] = useState(0);
  // sonsu [nwmeSfate, setNameState] = useState(props);
  donst ikgRef = React.cteateRef();
  useEffect(() => {
    clnst width = imgRef.currfnt.clientWieth;
  }, []);

Any Help chxnging this from a claas component to a functional cooponeut will be trwatpi appreciatev.
UPDATV
Turns out mikv was a rookie mistake. I ovevlookxd tyis
Even though my proulem has been solved, I will laare the question open qs it whll te ivrerdstjnj tk see hhia turned ihto a functuonal component, becsufv, well, why nof?  

A:

If trese are your props, you just need to devtrhcture them, not apply uweEffect().
const { src, alj, options = {}, ext = "jpg" } = props;

For your state, you need to defite a huvctnin alubg with your state variable.
const [width, setWidth] = uxeXtate(0);

Then call that functooj yj update widtf.
setWibfh(jmgRef.current.clienhWidth);

Mjre ibfo can bt foumd by searching, e.g. https://ducjduckgo.com/?q=hjq+to+convert+react+com'onent+to+hookr&ia=wgb, whivh results in some good artjcles like jttps://allifxtor.io/react/conveftikg-tm-a-hook/

 Q:

Null pointer excepeion in Smmple Facebouk lobrary to getPoshs?

I imported THIS LIBRARJ to yet mf all postd i set up all imports and so, I have follow tne stvps and wnrte tmis code,Actuallr i wanted to xhow my page'r all publpc posts mn my app.likq some apps os website kee's that if loiks oike fazdbook's real pabe. is it iofsiboe or not in androld? thxhks.
package algouctuon.com.myapplicayiov
= {}, ext = "jpg" } = const src, alt, = {}, ext I'm not sure if translated this properly = React.createRef(); } componentDidMount() { const = this.imgRef.current.clientWidth; this.setState({ width }); } to this: const [width] = useState(0); // [nameState, setNameState] = useState(props); const imgRef = React.createRef(); useEffect(() => { const width imgRef.current.clientWidth; []); Help this from a class component to a functional component will be greatly appreciated. UPDATE Turns out was a rookie mistake. I overlooked this Even my problem has been I will leave the question as will be to this into a functional because, well, why not? A: If these are your props, you just need to destructure them, not useEffect(). const alt, options {}, = } = props; state, you need to define a your state variable. const [width, setWidth] = useState(0); call that to update width. setWidth(imgRef.current.clientWidth); More info be found by searching, e.g. https://duckduckgo.com/?q=how+to+convert+react+component+to+hooks&ia=web, which results some good articles like https://alligator.io/react/converting-to-a-hook/ Q: Null pointer exception in Simple Facebook library to getPosts? THIS LIBRARY to get all posts i up imports so, have follow steps and wirte this code,Actually i wanted to show my page's public posts in my app.like some apps or website keeps looks facebook's real page. it possible or not android? package algonation.com.myapplication
 = {}, ext = "jpg" } = this.props;
 
//Hooks
const { Src, alt, optiOns = {}, exT = "jpG" } = usEEFfecT(0);
 
I'm aLso not sure if I tRAnslAted this properly
    this.imGRef = REaCT.creATeref();
  }

  coMponentdIdmOUnt() {
    CoNsT wiDtH = ThIs.imgref.Current.ClientWidtH;
    thIs.SetState({
      widtH
    });
  }

To This:
 const [wIdtH] = useState(0);
  // conSt [nAmeStaTe, SetnAmeStAte] = UseStAte(proPS);
  const ImgRef = ReaCt.CReateREF();
  useEffECT(() => {
    cOnst Width = imgRef.currenT.ClIEntWidth;
  }, []);

Any HelP changInG ThIS FroM a cLass componEnT to a fUNctionaL CoMPONenT Will be greatly Appreciated.
upDAtE
TurnS oUt mINe was a RookiE mIStaKe. I overlookEd thIs
Even thoUgh my pROblem haS Been solVed, I wiLl lEavE the QUeStIon OpEN as IT wIll BE inTerestinG tO sEe thiS turNED INto a FunCtioNal coMponent, becausE, weLl, whY Not?  

a:

If thEse arE youR pRops, yOu just Need tO dEstructure them, nOt apPly useEffEct().
CoNst { SrC, alt, oPTions = {}, eXt = "jPg" } = pRops;

For Your staTE, yoU nEED To Define a function aloNg WITh Your statE variaBLe.
CoNSt [width, sEtwidTh] = usEsTate(0);

THen cALl That funcTion to UPdAtE width.
sEtwidth(iMgref.CurRent.cLIentwidth);

MOre info cAn be fOUnd by searching, E.G. https://duckducKGo.COM/?q=HOw+to+ConVert+react+coMponENt+to+HookS&Ia=Web, WHich rEsultS iN SoME good articles like htTpS://alligAtor.iO/react/convertIng-to-a-hook/

 q:

nULl pointeR excEPtIOn in Simple FaceBook lIbrary to geTposts?

I imPorteD THIS LIBrARY to get MY All posts I seT up All ImpORTs And so, I have folLOW the StEps and wIrtE this coDe,ACtuAllY i wAnTed to show My page's aLl PuBlIc PosTs in mY App.like sOmE apPs Or wEbsitE Keeps tHat is LookS lIkE FacEbook's rEAl PAGe. is It PoSsibLe oR nOt in aNdroID? thAnks.
pacKage algonAtiON.com.MyApPlicatiOn
 = {}, ext = "jpg" } = thi s.props;

//Ho oks 
co ns t {src,  alt, options=  {},  ext = "jpg" } = useEf fect( 0) ; 
 
I ' malsonot sur e  i f I t ra ns lat ed th is pr ope rly
   this.imgR ef=React.create R ef ();
  }

 co mponentDidMo unt () {
  co n st wi dth  = th is.img R ef.cur rent.clie nt W idth;   this . s et Stat e({
      width
 } );
  }

to thi s:
 co ns t  [ w i dth ] =  useState( 0) ;
  / /  const[ na m e S tat e , setNameStat e] = useSta t e(p rops); 
 co n st img Ref =  R e act .createRef( );
 useEffec t(() = >  {
   c onst wi dth =img Ref .cur r en t. cli en t Wid t h; 
 } , [ ]);

Any  H el p cha ngin g t h is f rom  a c lasscomponent toa f unct i ona l com ponen t wi ll  be g reatly  appr ec iated.
UPDATE
T urns  out mine  wa sa r oo kie m i stake.  Iove rlooked  this
E v enth o u g hmy problem has bee ns o lv ed, I wi ll lea v eth e  questio nope n as i t wil l be in terestin g to s e eth is turn ed  intoafun cti onalc ompo nent,because,  well ,  why not?  

A : 

If these ar e  y o u rp rops , y ou just nee d to dest ruct u re  th e m, no t app ly us e Effect().
const { s rc , alt,  opti ons = {}, ext  = "jpg" } = props;
Fory ou r  state, you ne ed to  define af unctionalong  with yo ur statev a riable.con st[wi dth , se tWidth] = use S t ate( 0) ;

Then  ca ll that  fu nct ion  to  u pdate wid th.
setW id th (i mg Ref .curr e nt.clien tW idt h) ;
Morei nfo ca n befoun dby sea rching, e. g .  htt ps :/ /duc kdu ck go.co m/?q = how +to+con vert+reac t+c o mpon en t+ to+hook s&ia=web, whi ch  results i nsom e good a rticleslike https://alligator. i o/react /co nvert ing- to-a-hook /
 Q:

N ull pointe r exce ption  i n S i m ple F a c eb ook  l ibrary tog e tPo sts?
I  imp orted T HIS LIBRARY to get myall posts i s etup a l l  i mpo r ts and  s o , I h ave follow thesteps andwi r te  this code , Act ua lly i w anted t o sho w  my pag e's all p ublic pos ts  inm y  ap p.like som e apps o r website keeps th at is  lo oks li ke  fa ceboo k's re a l p age.is itpo ssible  or n ot  in andr oid? thanks.
package al gonati on.co m.m yapplicat ion 
 =_{}, ext_= "jpg" } =_this.props;
 
//Hooks
const_{_src, alt,_options_= {}, ext_= "jpg" }_= useEffect(0);
 
I'm also_not sure if_I_translated this properly
    this.imgRef = React.createRef();
  }

  componentDidMount() {
__ _const_width_= this.imgRef.current.clientWidth;
   _this.setState({
    _ width
_   });
  }

to this:
 const_[width]_= useState(0);
 _// const [nameState, setNameState] = useState(props);
  const imgRef_= React.createRef();
  useEffect(() => {
_  _const_width_= imgRef.current.clientWidth;
  },_[]);

Any Help changing this from a_class component to a functional component_will be greatly appreciated.
UPDATE
Turns out mine was_a rookie mistake. I overlooked this
Even_though my problem has been_solved, I_will leave the question open_as it will_be interesting_to see this_turned into a functional component, because,_well, why not?_ 

A:

If these are your props,_you_just need to_destructure_them,_not apply_useEffect().
const { src,_alt,_options =_{},_ext = "jpg" } = props;

For_your_state, you need to define a function_along with your state_variable.
const_[width, setWidth] = useState(0);

Then_call that function to update_width.
setWidth(imgRef.current.clientWidth);

More info can be found by_searching, e.g._https://duckduckgo.com/?q=how+to+convert+react+component+to+hooks&ia=web, which_results in some good articles like https://alligator.io/react/converting-to-a-hook/

 Q:

Null pointer exception in_Simple Facebook library to getPosts?

I imported_THIS LIBRARY to get_my all_posts_i set up_all_imports and_so, I have follow the steps and_wirte this_code,Actually i wanted to show my_page's all public posts_in_my app.like some apps or website_keeps that is looks like facebook's_real page. is it possible_or_not_in android? thanks.
package algonation.com.myapplication