Answers for "use recoil oitside"

0

use recoil oitside

import React from 'react';
import RecoilOutside from "recoil-outside";
import { RecoilRoot } from "recoil";
import Main from "./Main"

const App = () => {
	return (
	    <RecoilRoot>
	    	<RecoilOutside/>
           	<Main />
        </RecoilRoot>
    );
};

export default App;

// Other File
import { promiseSetRecoil, promiseGetRecoil } from "recoil-outside"import { store } from "./Store"

export const setTest = async() => {
	await promiseSetRecoil(store, "Success")
}
export const getTest = async() => {
	const value = await promiseGetRecoil(store)
	return value
}
Posted by: Guest on February-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language