Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
}
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #recoil #oitside
ADD COMMENT
Topic
Name
2+5 =