translated: useEffect hook by lifeparticle · Pull Request #44 · reactjs/bn.react.dev

* `setup`: The function with your Effect's logic. Your setup function may also optionally return a *cleanup* function. When your component is added to the DOM, React will run your setup function. After every re-render with changed dependencies, React will first run the cleanup function (if you provided it) with the old values, and then run your setup function with the new values. After your component is removed from the DOM, React will run your cleanup function. * **optional** `dependencies`: The list of all reactive values referenced inside of the `setup` code. Reactive values include props, state, and all the variables and functions declared directly inside your component body. If your linter is [configured for React](/learn/editor-setup#linting), it will verify that every reactive value is correctly specified as a dependency. The list of dependencies must have a constant number of items and be written inline like `[dep1, dep2, dep3]`. React will compare each dependency with its previous value using the [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) comparison. If you omit this argument, your Effect will re-run after every re-render of the component. [See the difference between passing an array of dependencies, an empty array, and no dependencies at all.](#examples-dependencies) * `setup`: আপনার ইফেক্টের যুক্তি সহ ফাংশন। আপনার সেটআপ ফাংশন অপশনালি একটি *cleanup* ফাংশন রিটার্ন করতে পারে। যখন আপনার কম্পোনেন্টটি DOM-এ যুক্ত করা হয়, React আপনার সেটআপ ফাংশন চালাবে। প্রতিটি রি-রেন্ডারের পরে পরিবর্তিত ডিপেন্ডেন্সি সহ, React প্রথমে পুরানো মানগুলির সাথে আপনার cleanup ফাংশন চালাবে (আপনি যদি এটি প্রদান করেন), এবং তারপর নতুন মানগুলির সাথে আপনার সেটআপ ফাংশন চালাবে। আপনার কম্পোনেন্টটি DOM থেকে সরানোর পরে, React আপনার cleanup ফাংশন চালাবে।