PageSourceSearch

https://advanced-react-hooks.netlify.app/static/js/645.f7cc17a5.chunk.js

js advanced-react-hooks.netlify.app collected 2026-10-03 10:25:58 UTC 3,501 bytes, 3 lines download raw bytes

1/*! For license information please see 645.f7cc17a5.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkadvanced_react_hooks=self.webpackChunkadvanced_react_hooks||[]).push([[645],{7645:function(e,t,o){o.r(t);var n=o(9439),r=o(4519),i=o(2556);function u(e){var t=e.messages,o=r.useRef();return r.useLayoutEffect((function(){o.current.scrollTop=o.current.scrollHeight})),(0,i.jsx)("div",{ref:o,role:"log",children:t.map((function(e,t,o){return(0,i.jsxs)("div",{children:[(0,i.jsx)("strong",{children:e.author}),": ",(0,i.jsx)("span",{children:e.content}),o.length-1===t?null:(0,i.jsx)("hr",{})]},e.id)}))})}t.default=function(){var e=r.useRef(),t=r.useState(s.slice(0,8)),o=(0,n.Z)(t,2),a=o[0],l=o[1];return(0,i.jsxs)("div",{className:"messaging-app",children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,i.jsx)("button",{onClick:function(){return a.length<s.length?l(s.slice(0,a.length+1)):null},children:"add message"}),(0,i.jsx)("button",{onClick:function(){return a.length>0?l(s.slice(0,a.length-1)):null},children:"remove message"})]}),(0,i.jsx)("hr",{}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:function(){return e.current.scrollToTop()},children:"scroll to top"})}),(0,i.jsx)(u,{ref:e,messages:a}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{onClick:function(){return e.current.scrollToBottom()},children:"scroll to bottom"})})]})};var s=["Leia: Aren't you a little short to be a stormtrooper?","Luke: What? Oh... the uniform. I'm Luke Skywalker. I'm here to rescue you.","Leia: You're who?","Luke: I'm here to rescue you. I've got your R2 unit. I'm here with Ben Kenobi.","Leia: Ben Kenobi is here! Where is he?","Luke: Come on!","Luke: Will you forget it? I already tried it. It's magnetically sealed!","Leia: Put that thing away! You're going to get us all killed.","Han: Absolutely, Your Worship. Look, I had everything under control until you led us down here. You know, it's not going to take them long to figure out what happened to us.","Leia: It could be worse...","Han: It's worse.","Luke: There's something alive in here!","Han: That's your imagination.","Luke: Something just moves past my leg! Look! Did you see that?","Han: What?","Luke: Help!","Han: Luke! Luke! Luke!","Leia: Luke!","Leia: Luke, Luke, grab a hold of this.","Luke: Blast it, will you! My gun's jammed.","Han: Where?","Luke: Anywhere! Oh!!","Han: Luke! Luke!","Leia: Grab him!","Leia: What happened?","Luke: I don't know, it just let go of me and disappeared...","Han: I've got a very bad feeling about this.","Luke: The walls are moving!","Leia: Don't just stand there. Try to brace it with something.","Luke: Wait a minute!","Luke: Threepio! Come in Threepio! Threepio! Where could he be?"].map((function(e,t){return{id:t,author:e.split(": ")[0],content:e.split(": ")[1]}}))},3238:function(e,t,o){var n=o(4519),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,o){var n,i={},l=null,h=null;for(n in void 0!==o&&(l=""+o),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(h=t.ref),t)u.call(t,n)&&!a.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:r,type:e,key:l,ref:h,props:i,_owner:s.current}}t.Fragment=i,t.jsx=l,t.jsxs=l},2556:function(e,t,o){e.exports=o(3238)}}]);
3//# sourceMappingURL=645.f7cc17a5.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.